Re: run Unix commands from script!

2010-04-09 Thread John W. Krahn
Niko zuna wrote: Hi! Hello, I made this short script in order to see if there is posible to run "modified" unix commands from a Perl script. #!/usr/bin/perl use strict; use warnings; my $load = `uptime | awk '{print $8 $9 $10 $11 $12}'`; my ( $load ) = `uptim

Re: run Unix commands from script!

2010-04-09 Thread Shlomi Fish
On Friday 09 Apr 2010 18:31:31 Niko zuna wrote: > Hi! > > I made this short script in order to see if there is posible to run > "modified" unix commands from a Perl script. > > #!/usr/bin/perl > > > > use > strict; > > use > warnings; >

Re: run Unix commands from script!

2010-04-09 Thread Shawn H Corey
Niko zuna wrote: Hi! I made this short script in order to see if there is posible to run "modified" unix commands from a Perl script. #!/usr/bin/perl use strict; use warnings; my $load = `uptime | awk '{print $8 $9 $10 $11 $12}'`; print "$load\n"; when

Re: run Unix commands from script!

2010-04-09 Thread Brandon McCaig
On Fri, Apr 9, 2010 at 11:31 AM, Niko zuna wrote: > Use of uninitialized value $8 in concatenation (.) or string at ./test.plline > 6. > Use of uninitialized value $9 in concatenation (.) or string at ./test.plline > 6. > Use of uninitialized value $10 in concatenation (.) or string at > ./test.

run Unix commands from script!

2010-04-09 Thread Niko zuna
Hi! I made this short script in order to see if there is posible to run "modified" unix commands from a Perl script. #!/usr/bin/perl use strict; use warnings; my $load = `uptime | awk '{print $8 $9 $10 $11 $12}'`; print "$load\n"; when I am trying to ru

run Unix commands from script!

2010-04-09 Thread Niko zuna
Hi! I made this short script in order to see if there is posible to run "modified" unix commands from a Perl script. #!/usr/bin/perl use strict; use warnings; my $load = `uptime | awk '{print $8 $9 $10 $11 $12}'`; print "$load\n"; when I am trying to ru

Re: for output from other unix commands

2009-10-09 Thread Jim Gibson
On 10/9/09 Fri Oct 9, 2009 7:43 AM, "Harry Putnam" scribbled: > I'm thinking of splitting on something like ' +' (+) since > no regular output will have 2 spc or more between connected > words I mean words that belong in a group. I would use the construct /\s{2,}/ for "two or more spaces"

Re: for output from other unix commands

2009-10-09 Thread Harry Putnam
Jim Gibson writes: > You might try splitting the line on whitespace, extracting the first two and > last two elements, then joining the remainder back with a space. You can > then test the length of the middle string for excessive length and print or > trim accordingly. This will concatenate any

Re: for output from other unix commands

2009-10-08 Thread Jim Gibson
On 10/8/09 Thu Oct 8, 2009 3:56 PM, "Harry Putnam" scribbled: > Shlomi Fish writes: > >> Hi Harry! > > [...] > >>> >>> I want to catch those long lines and format them like one might format >>> a news/mail message... wrapped at column 72 or so but also indented >>> whatever spcs looks good

Re: for output from other unix commands

2009-10-08 Thread Harry Putnam
Shlomi Fish writes: > Hi Harry! [...] >> >> I want to catch those long lines and format them like one might format >> a news/mail message... wrapped at column 72 or so but also indented >> whatever spcs looks good. >> >> I looked at perldoc -f format but that says its about pictures and >> do

Re: for output from other unix commands

2009-10-08 Thread Shlomi Fish
Hi Harry! On Thursday 08 Oct 2009 21:29:04 Harry Putnam wrote: > I'm just looking for a push to get started... I do have some perl > skills (pretty lowlevel to be sure) so can do basic formating with > printf and such. > > But here... I expect my input to be pretty uniform actually already > form

for output from other unix commands

2009-10-08 Thread Harry Putnam
I'm just looking for a push to get started... I do have some perl skills (pretty lowlevel to be sure) so can do basic formating with printf and such. But here... I expect my input to be pretty uniform actually already formatted ok. Except, 1 or 2 lines somewhere in the input that will be longer a

Re: unix commands

2007-09-20 Thread John W. Krahn
lerameur wrote: Hello, Hello, I want to write a perl script that invokes unix command. perldoc -f qx perldoc -f system perldoc -f fork perldoc -f exec perldoc -f open perldoc perlipc perldoc perlopentut perldoc IPC::Open2 perldoc IPC::Open3 perldoc IPC::Run perldoc Expect perldoc Shell

RE: unix commands

2007-09-20 Thread Andrew Curry
Think you mean foreground or background. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 20 September 2007 15:59 To: lerameur; beginners@perl.org Subject: Re: unix commands --- lerameur <[EMAIL PROTECTED]> wrote: > Hello, > > I want to writ

Re: unix commands

2007-09-20 Thread useperl-jeff
--- lerameur <[EMAIL PROTECTED]> wrote: > Hello, > > I want to write a perl script that invokes unix command. Some of the > command can take a long time to process, I have many commands I want > to invoke. Lets say the first command can take one minute to > process, how can I make sure the se

unix commands

2007-09-20 Thread lerameur
Hello, I want to write a perl script that invokes unix command. Some of the command can take a long time to process, I have many commands I want to invoke. Lets say the first command can take one minute to process, how can I make sure the second command will not start until the irst one is comp

Re: How to parse UNIX commands ...

2006-10-27 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > Hi all, Hello, > How do I parse or evaluate the output of UNIX commands? > > For example, in UNIX scripts, I can run filesystem=`df -k | awk -F"" ' { print > $6 }'` to check for the mount points. > > How do I achieve the sa

RE: How to parse UNIX commands ...

2006-10-26 Thread Thomas Bätzler
Hi, [EMAIL PROTECTED] asked: > How do I parse or evaluate the output of UNIX commands? > > For example, in UNIX scripts, I can run filesystem=`df -k | > awk -F"" ' { print > $6 }'` to check for the mount points. > > How do I achieve the same in Perl? T

Re: How to parse UNIX commands ...

2006-10-26 Thread Arnaldo Guzman
On Fri, 2006-10-27 at 17:30 +1300, [EMAIL PROTECTED] wrote: > Hi all, > > How do I parse or evaluate the output of UNIX commands? > > For example, in UNIX scripts, I can run filesystem=`df -k | awk -F"" ' { print > $6 }'` to check for the mount points.

How to parse UNIX commands ...

2006-10-26 Thread benbart
Hi all, How do I parse or evaluate the output of UNIX commands? For example, in UNIX scripts, I can run filesystem=`df -k | awk -F"" ' { print $6 }'` to check for the mount points. How do I achieve the same in Perl? That is, I tried: #!/usr/bin/perl $x=s

RE: Cygwin: Port of unix commands or unix-like environment

2004-03-05 Thread David le Blanc
> -Original Message- > From: Joel [mailto:[EMAIL PROTECTED] > Sent: Saturday, 6 March 2004 1:29 PM > To: perl > Subject: Re: hi!! I've changed your subject to be more appropriate to the question asked. > > This is off topic, but is cygwin just the ports of GNU > software for windows, >

Re: Help with UNIX commands

2003-11-16 Thread Mame Mbodji
Rob: Thank you for responding to my post! I just got back from a long week end. Did not check my email [EMAIL PROTECTED] wrote: Wiggins D'Anconia wrote: Mame Mbodji wrote: I am researching some unix commands and I would like to know if someone knows where I can find them online. I

Re: Help with UNIX commands

2003-11-16 Thread Rob Dixon
Wiggins D'Anconia wrote: > > Mame Mbodji wrote: > > I am researching some unix commands and I would like to know if someone > > knows where I can find them online. I just want to know what are they > > used for and if there are some available examples online.The c

Re: Help with UNIX commands

2003-11-15 Thread Tore Aursand
On Fri, 14 Nov 2003 20:36:54 -0500, Mame Mbodji wrote: > I am researching some unix commands and I would like to know if someone > knows where I can find them online. What does this have to do with Perl? The obvious answer, though, is to tap twice on the TAB key, write down what you se

Re: Help with UNIX commands

2003-11-14 Thread Chuck Fox
[EMAIL PROTECTED] wrote: I am researching some unix commands and I would like to know if someone knows where I can find them online. I just want to know what are they used for and if there are some available examples online.The commands are: snapshot and sdtprocess. Sorry if this is not the

Re: Help with UNIX commands

2003-11-14 Thread Wiggins d'Anconia
Mame Mbodji wrote: I am researching some unix commands and I would like to know if someone knows where I can find them online. I just want to know what are they used for and if there are some available examples online.The commands are: snapshot and sdtprocess. Sorry if this is not the right

Help with UNIX commands

2003-11-14 Thread Mame Mbodji
I am researching some unix commands and I would like to know if someone knows where I can find them online. I just want to know what are they used for and if there are some available examples online.The commands are: snapshot and sdtprocess. Sorry if this is not the right place to post this

Using external Unix commands

2003-09-04 Thread c s secret
I cant use Telnet or Sockets because the modules are not loaded on. I want to automate telnets to a list of ips. It looks like this is running but I am not prompted for a login and password until after I interupt the script. How can I get the prompts sent to the display then return to the per

Re: run UNIX commands from windows using Perl

2003-02-10 Thread Jose Malacara
You should be able to do this using the Perl Expect module, although not sure about the Windows part. -Jose - Original Message - From: "Prachi Shah" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 10, 2003 1:08 PM Subject: run UNIX commands f

run UNIX commands from windows using Perl

2003-02-10 Thread Prachi Shah
Hi All! Is there a way to login to a UNIX system, run an application and retrieve a file written by that application using Perl from a Windows system? thanks, Prachi. _ The new MSN 8: smart spam protection and 2 months FREE* h

Re: perl with unix commands

2002-06-14 Thread Ramprasad A Padmanabhan
Did U chk the directory u r in try doing this `cd $DIRECTORY; cp src dest `; Ronnie Livingston wrote: > Hi, I have a textfile with a list of gifs (ex. planet.gif, star.gif)and I > have a perl program which grabs one of the filenames randomly. What I > want to do is use the filename and copy it

Re: perl with unix commands

2002-06-14 Thread Ronnie Livingston
doh, that did it. thanks felix. -Ronnie On 14 Jun 2002, Felix Geerinckx wrote: > on Fri, 14 Jun 2002 06:43:53 GMT, [EMAIL PROTECTED] (Ronnie > Livingston) wrote: > > > Hi, I have a textfile with a list of gifs (ex. planet.gif, > > star.gif)and I have a perl program which grabs one of the > > fi

Re: perl with unix commands

2002-06-14 Thread Felix Geerinckx
on Fri, 14 Jun 2002 06:43:53 GMT, [EMAIL PROTECTED] (Ronnie Livingston) wrote: > Hi, I have a textfile with a list of gifs (ex. planet.gif, > star.gif)and I have a perl program which grabs one of the > filenames randomly. What I want to do is use the filename and > copy it to random.gif but I k

perl with unix commands

2002-06-13 Thread Ronnie Livingston
Hi, I have a textfile with a list of gifs (ex. planet.gif, star.gif)and I have a perl program which grabs one of the filenames randomly. What I want to do is use the filename and copy it to random.gif but I keep getting the error: cp: cannot access planet.gif I have been using this in my perl p

Re: Unix commands in Perl scripts

2002-02-21 Thread Jonathan E. Paton
> Hi guys, > > I was wondering if anyone knows how to execute Unix > commands in a Perl Script? system(echo Hello World); my $output = qx(echo Hello There); print "The shell said :$output\n"; perldoc -f system perldoc

Re: Unix commands in Perl scripts

2002-02-20 Thread Paresh Kakrecha
system( "cat myfile"); or qx( cp file1 file2); At 03:16 PM 2/20/2002 -0800, John W. Krahn wrote: >Tony Ho wrote: > > > > Hi guys > >Hello, > > > I was wondering if anyone knows how to execute Unix commands in a Perl > > Script ? > > >u

Re: Unix commands in Perl scripts

2002-02-20 Thread John W. Krahn
Tony Ho wrote: > > Hi guys Hello, > I was wondering if anyone knows how to execute Unix commands in a Perl > Script ? use Shell; my $ps = ps( 'ax' ); print $ps; my @ls = ls( '-al' ); print $ls[ 7 ]; perldoc Shell John -- use Perl; program fulfill

RE: Unix commands in Perl scripts

2002-02-20 Thread Brett W. McCoy
On Wed, 20 Feb 2002, Booher Timothy B 1stLt AFRL/MNAC wrote: > You simply enclose your unix commands in ''. > > i.e. > > #!untested > > 'ls -la' I think you mean ` `, (backticks), right? -- Brett

RE: Unix commands in Perl scripts

2002-02-20 Thread Booher Timothy B 1stLt AFRL/MNAC
Tony, You simply enclose your unix commands in ''. i.e. #!untested 'ls -la' tim Timothy B Booher, Lt USAF Research Engineer AFRL/MNAC 101 W. Eglin Blvd. Eglin AFB, FL 32542-6810 Telephone: 850-882-8302 ext. 336

Re: Unix commands in Perl scripts

2002-02-20 Thread William.Ampeh
If I understood your question, you could use "system" or "command ticks". That is: system("cal") //be careful or $a = `cal`; depending on how you want to treat the output. If you want to manipulate the output, use command ticks. __ William Ampeh (x3939) Federal Reser

RE: use unix commands

2002-02-20 Thread Ken Clark
This is easy to manipulate, though as time has went by I've found that perl already can do what i try to do by using system commands. here's a quick example with backticks, though it is not the only way, or correct one dependent on your need. this would require fortune to be in your path ahead of

RE: Unix commands in Perl scripts

2002-02-20 Thread Michael Pastore
t;jfserver.log","-z".$P DFPath.$PDFName); The second argument JFMERGE is a .exe Regards, Mike -Original Message- From: Ho, Tony [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 11:49 AM To: '[EMAIL PROTECTED]' Subject: Unix commands in Perl scripts

Unix commands in Perl scripts

2002-02-20 Thread Ho, Tony
Hi guys I was wondering if anyone knows how to execute Unix commands in a Perl Script ? I would be most grateful if you could let me know Thanks in advance Tony

Re: Calling UNIX Commands?

2001-08-06 Thread Brett W. McCoy
On Mon, 6 Aug 2001, Chris Garaffa wrote: > Hello everyone. I just joined the list, but I checked the archive earlier > to see if this was covered. Sorry if I missed it. > > My question is regarding UNIX commands. I know you can get the output of a > command using the ` notation

RE: Calling UNIX Commands?

2001-08-06 Thread Matt Crapo
f thumb - if you can avoid using a system call, do so. Good Luck! Matt -Original Message- From: Peter Scott [mailto:[EMAIL PROTECTED]] Sent: Monday, August 06, 2001 5:18 PM To: Chris Garaffa; [EMAIL PROTECTED] Subject: Re: Calling UNIX Commands? At 08:15 PM 8/6/01 -0400, Chris Garaffa

Re: Calling UNIX Commands?

2001-08-06 Thread Peter Scott
At 08:15 PM 8/6/01 -0400, Chris Garaffa wrote: >My question is regarding UNIX commands. I know you can get the output of a >command using the ` notation. My script has this line: >my $command = `mv /$formdata{name}.html /Library/WebServer/Document/About/ >$formdata{name}.html`; You

Calling UNIX Commands?

2001-08-06 Thread Chris Garaffa
Hello everyone. I just joined the list, but I checked the archive earlier to see if this was covered. Sorry if I missed it. My question is regarding UNIX commands. I know you can get the output of a command using the ` notation. My script has this line: my $command = `mv /$formdata{name}.html

Re: Perl UNIX commands

2001-06-14 Thread Peter Scott
At 11:33 AM 6/14/01 -0500, John Joseph Roets wrote: >I found a site a while back which detailed a pursuit to develop Perl >commands to replace universal UNIX commands. >Thus, providing advanced benefits/features, such as more full regex matching >abilities, etc. >My problem: >

Re: Perl UNIX commands

2001-06-14 Thread iain truskett
* John Joseph Roets ([EMAIL PROTECTED]) [14 Jun 2001 16:34]: > I found a site a while back which detailed a pursuit to develop Perl > commands to replace universal UNIX commands. Thus, providing advanced > benefits/features, such as more full regex matching abilities, etc. > My p

Perl UNIX commands

2001-06-14 Thread John Joseph Roets
I found a site a while back which detailed a pursuit to develop Perl commands to replace universal UNIX commands. Thus, providing advanced benefits/features, such as more full regex matching abilities, etc. My problem: I cannot now find this site. I can't even remember how I came acro

Re: interactive unix commands

2001-05-12 Thread Brett W. McCoy
On Sat, 12 May 2001, cherukuwada subrahmanyam wrote: > Is there any way we can use perl to execute interactive unix commands > without being prompted for arguments? Of course. You can pipe into the programs standard input. Or you can use the Exepct module form CPAN. --

Re: interactive unix commands

2001-05-12 Thread Me
> Is there any way we can use perl to execute interactive > unix commands without being prompted for arguments? In general, just pipe into the command's standard input. > Ex:- passwd command asks for the password. I suspected passwd might be different, so I did a quick deja

interactive unix commands

2001-05-12 Thread cherukuwada subrahmanyam
Hi, Is there any way we can use perl to execute interactive unix commands without being prompted for arguments? Ex:- passwd command asks for the password. Can we use perl to make a wrapper around the passwd command so that we can pass the arguments to the wrapper while executing it i.e wrap.pl