system command

2008-11-26 Thread Sharan Basappa
Hi, I am trying to launch a program using system command. The program usually takes 20-30 minutes to complete. I launch the programs in a loop. Will the system command wait for first program to complete and then proceed to the next one. What if I want to launch these programs in parallel which is

system() command

2004-06-08 Thread june tantoolvesm
Hi, I hope this is the right mailing list. I have two questions. 1. I was wondering if anyone here knows what this command is doing, besides calling the program "neighbor"? system ("neighbor >/dev/null 2>&1 << ! $inpwd 2 3 Y !") I understand up to "2>&1", does anyone knows what comes after that

system() command

2004-06-08 Thread june tantoolvesm
Hi, I hope this is the right mailing list. I have two questions. 1. I was wondering if anyone here knows what this command is doing, besides calling the program "neighbor"? system ("neighbor >/dev/null 2>&1 << ! $inpwd 2 3 Y !") I understand up to "2>&1", does anyone knows what comes after that

system() command

2004-06-08 Thread june tantoolvesm
Hi, I hope this is the right mailing list. I have two questions. 1. I was wondering if anyone here knows what this command is doing, besides calling the program "neighbor"? system ("neighbor >/dev/null 2>&1 << ! $inpwd 2 3 Y !") I understand up to "2>&1", does anyone knows what comes after that

system() command

2004-06-08 Thread june tantoolvesm
Hi, I hope this is the right mailing list. I have two questions. 1. I was wondering if anyone here knows what this command is doing, besides calling the program "neighbor"? system ("neighbor >/dev/null 2>&1 << ! $inpwd 2 3 Y !") I understand up to "2>&1", does anyone knows what comes after that

system command

2002-02-05 Thread Ned Cunningham
What is the proper and best way to use the system command??? System('command'); Or (system 'command'); Please help! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Running system command or batch file using system "[command]"

2006-08-12 Thread benbart
running OS commands or BATCH files besides the system command. Thanks ... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

system command question

2011-09-28 Thread Amish Rughoonundon
do this in perl using a system call but it failed system("SET A_DIR=C:\\TOOLS\\TMS320 & SET C_DIR=C:\\TOOLS\\TMS320 & PATH=\%PATH\%;C:\\TOOLS;C:\\TOOLS\\TMS320 & make > compilation_output.txt"); Any idea why the system command is not setting the path and A_DIR and C_DIR

"system" command help

2005-11-09 Thread heena s
hi, is there any mistake in the script: #ADDING A TOOL GROUP system("$addgroup \"$group\"") == 0 or die "system @args failed: $?" &log_message("the group $group added"); thanks - Yahoo! FareChase - Search multiple tr

Re: system command

2008-11-26 Thread Mr. Shawn H. Corey
On Wed, 2008-11-26 at 20:43 +0530, Sharan Basappa wrote: > Hi, > > I am trying to launch a program using system command. > The program usually takes 20-30 minutes to complete. > I launch the programs in a loop. > Will the system command wait for first program to complete and the

Re: system command

2008-11-26 Thread Rob Coops
On Wed, Nov 26, 2008 at 4:21 PM, Jeff Pang <[EMAIL PROTECTED]> wrote: > > Message du 26/11/08 16:13 > > De : "Sharan Basappa" > > A : "Perl Beginners" > > Copie à : > > Objet : system command > > > > > > Hi, > > &

Re: system command

2008-11-26 Thread Deviloper
r semaphores, heaps and queues. Bye, B.   Sharan Basappa <[EMAIL PROTECTED]> hat am 26. November 2008 um 16:13 geschrieben: > Hi, > > I am trying to launch a program using system command. > The program usually takes 20-30 minutes to complete. > I launch the programs i

Re: system command

2008-11-26 Thread Sharan Basappa
> Or you might want to use threads, though they are certainly not the same > both have their advantages and you might want to read up on them before > making a decission on which to use. > > In any case I would advise you to first, use which ever way of modeling you > prefer, to draw out the way th

"system" command failure

2001-09-12 Thread Tyler Cruickshank
Hello. I am trying to use the system command to run a FORTRAN program on my Solaris 5.7 system. In the code pasted below the following system call: system("chmod 777 /trinidad/uamaero/inputConversions/Bin2Ascii/bin2asciiInputFile.in"); works just fine. When I actually try to run

system command interraction

2002-06-04 Thread Mat Harris
i am writing a perl script to run as a cron job and backup my files using dump. i have defined vars containing stuff like backup target, level of backup and so on. I want to issue the command to the command line, including the values of these vars. I have tried backticking and the system

RE: system() command

2004-06-08 Thread Tim Johnson
e- From: june tantoolvesm [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 08, 2004 1:25 AM To: [EMAIL PROTECTED] Subject: system() command Hi, I hope this is the right mailing list. I have two questions. 1. I was wondering if anyone here knows what this command is doing, besides calling

Re: system() command

2004-06-08 Thread John W. Krahn
June Tantoolvesm wrote: > > Hi, Hello, > I hope this is the right mailing list. I have two > questions. > > 1. I was wondering if anyone here knows what this > command is doing, besides calling the program > "neighbor"? > > system ("neighbor >/dev/null 2>&1 << ! $inpwd 2 3 Y > !") > > I under

call system command

2007-05-14 Thread Tatiana Lloret Iglesias
Hi all, I have to execute this command from perl: my $status = system("d:\\blast\\bin\\blastall -p blastn -i $file -d $patDB -o $workdir\\blast_$blast_file_id.txt"); but the problem is that $workdir contains spaces how can I make it work? Thanks! Regards T

Perl "system" command

2002-01-22 Thread Kevin Kirwan
Guys, I've got a newbie question: I'm writing a Perl program to get some system information about particular users. The command(s): $command=q(/usr/bin/last vtran|head -1|awk '{print $4,$5}'); $Last=system "$command"; print $Last; This returns the fields that

system command problem

2002-03-15 Thread Gavin Nelmes-Crocker [CobaltWorld]
Guys, I've got a newbie question - I have been hacking at a perl script to change it to do what I want - it nearly does but I can't understand why the main bit isn't working. Basically the script gets sent a string from an html form which it then needs to use as part of a syste

redirect system command STDER

2011-07-19 Thread Tessio Fechine
Hello, I have a subroutine that uses useradd to create accounts -- @cmd = ('useradd', '-m', $account); my $result = system @cmd; -- but when useradd fails, I need to stop it from sending the error message to STDER. Is it possible with system? Thanks!

RE: system command question

2011-09-28 Thread Ken Slater
> -Original Message- > From: Amish Rughoonundon [mailto:amishrughoonun...@gmail.com] > Sent: Tuesday, September 27, 2011 4:44 PM > To: beginners@perl.org > Subject: system command question > > Hi, > I am trying to run a make file from perl. For the make file to

ulimit and system command

2005-09-23 Thread steve tran
Hello I am noticing a strange phenomenon and I would appreciate it if someone helped me understand it in my shell when I execute ulimit -a I get % ulimit -a time(seconds)unlimited file(blocks) unlimited data(kbytes) unlimited stack(kbytes)unlimited memory(kbytes

Re: "system" command help

2005-11-09 Thread Pablo Wolter
The system function call returns a boolean value as return value, I don't remember if 1 is for fail and 0 for success or viceversa. I think your mistake is the lack of the test construction like if, so if (system("$addgroup \"$group\"") == 0) { ... do something ... } I'm not in a box with perl t

Re: "system" command help

2005-11-09 Thread Marilyn Sander
On Nov 9, 2005, at 4:52 PM, Pablo Wolter wrote: The system function call returns a boolean value as return value, I don't remember if 1 is for fail and 0 for success or viceversa. Actually it is not a boolean value. It is a two-byte value, and each byte is an integer. You need to look up t

Re: "system" command help

2005-11-09 Thread Rakesh Mishra
On 11/10/05, Marilyn Sander <[EMAIL PROTECTED]> wrote: > > > On Nov 9, 2005, at 4:52 PM, Pablo Wolter wrote: > > > The system function call returns a boolean value as return value, I > > don't > > remember if 1 is for fail and 0 for success or viceversa. > > Actually it is not a boolean value. It i

Re: "system" command help

2005-11-10 Thread Shawn Corey
Marilyn Sander wrote: On Nov 9, 2005, at 4:52 PM, Pablo Wolter wrote: The system function call returns a boolean value as return value, I don't remember if 1 is for fail and 0 for success or viceversa. Actually it is not a boolean value. It is a two-byte value, and each byte is an integer.

Execute newgrp system command

2005-11-21 Thread Suvajit Sengupta
Hi, I want to login into a new group using 'newgrp' UNIX command.Every newgrp command invokes a new shell. But when I am trying to execute this system command from a perl script the script is terminating and returning the prompt of the new shell . Can anyone suggest on what can

Re: "system" command failure

2001-09-12 Thread Maxim Berlin
Hello Tyler, Thursday, September 13, 2001, Tyler Cruickshank <[EMAIL PROTECTED]> wrote: TC> Hello. I am trying to use the system command to run a FORTRAN TC> program on my Solaris 5.7 system. In the code pasted below the TC> following system call: TC> system(&qu

Re: "system" command failure

2001-09-12 Thread Robert Citek
.bat") should work. If it is a shell script, system("source bin2ascRunScript.bat") should work. However, if it is not a shell script, then system("source bin2ascRunScript.bat") will not work. HTH, - Robert At 04:14 PM 9/12/2001 -0600, Tyler Cruickshank wrote: >Hello. I am trying t

Timeout a system command

2002-04-07 Thread Darren Edgerton
Hi, i want to set a timer around a system command, so that IF the command runs longer than x seconds send email to the sysadmin Note: i *DO NOT* want to kill the process - simply want to send a warning that it is taking longer than expected ie $maxtime=60;# 60 seconds system

RE: system command interraction

2002-06-04 Thread Kipp, James
"dump -$level -u -A $archive_dest -f $backup_dest -j 9 $backup_target"; system ("$cmd") or die "command failed: $?"; -Original Message- From: Mat Harris [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 12:30 PM To: [EMAIL PROTECTED] Subject: system

Re: system command interraction

2002-06-04 Thread Jeff 'japhy' Pinyan
On Jun 4, Mat Harris said: >I want to issue the command to the command line, including the values of >these vars. I have tried backticking and the system('command here') but >they just send the vars as empty strings. Here's the program: #!/usr/bin/perl

RE: system command interraction

2002-06-04 Thread Jeff 'japhy' Pinyan
On Jun 4, Kipp, James said: >$date = `date +%y%m%e`; >$backup_dest = "/backup/home/" . "$date" . "-monthly"; Needless quoting of $date, and there's no reason to separate $date from the rest of the string: $backup_dest = "/backup/home/$date-monthly"; >$archive_dest = "/backup/home/archives/"

RE: system command interraction

2002-06-04 Thread Kipp, James
>try: >-- >#!/usr/bin/perl > >$date = `date +%y%m%e`; >$backup_dest = "/backup/home/" . "$date" . "-monthly"; >$archive_dest = "/backup/home/archives/" . "$date" . "-monthly"; >$backup_target = "/home/"; >$level = '0'; > >$cmd = "dump -$level -u -A $archive_dest -f $backup_dest -j 9 >$backup_targ

using the system command

2004-07-01 Thread Adamiec, Larry
I am running perl version 5.8.0 on a Sun Solaris 9.0 machine. Given the following bit of code: $SOME_FILE = $_; chomp($SOME_FILE); $SOME_SAFE_FILE = $SOME_FILE . "_lax"; system ("cp '$SOME_FILE' '$SOME_SAFE_FILE'"); open (IN_FILE, "$SOME_FILE" ); open (TMP_OUT_

Re: call system command

2007-05-14 Thread Xavier Noria
On May 14, 2007, at 3:44 PM, Tatiana Lloret Iglesias wrote: Hi all, I have to execute this command from perl: my $status = system("d:\\blast\\bin\\blastall -p blastn -i $file -d $patDB -o $workdir\\blast_$blast_file_id.txt"); but the problem is that $workdir contains spaces how can I

Re: call system command

2007-05-14 Thread Tatiana Lloret Iglesias
Thank a lot! Another related question,,, system command can be used also for linux? Regards T On 5/14/07, Xavier Noria <[EMAIL PROTECTED]> wrote: On May 14, 2007, at 3:44 PM, Tatiana Lloret Iglesias wrote: > Hi all, > > I have to execute this command from perl: > > m

Re: call system command

2007-05-14 Thread Xavier Noria
On May 14, 2007, at 3:52 PM, Tatiana Lloret Iglesias wrote: Thank a lot! Another related question,,, system command can be used also for linux? Sure. Of course it is unlikely that the arguments themselvels are portable in practice, I mean blastall won't probably be located at "d

Re: call system command

2007-05-14 Thread Chas Owens
On 5/14/07, Tatiana Lloret Iglesias <[EMAIL PROTECTED]> wrote: snip my $status = system("d:\\blast\\bin\\blastall -p blastn -i $file -d $patDB -o $workdir\\blast_$blast_file_id.txt"); snip Just an unrelated note to make your life a little easier, Perl automagically uses the right directory sepa

Re: call system command

2007-05-15 Thread Dr.Ruud
"Chas Owens" schreef: > Tatiana Lloret Iglesias: >> my $status = system("d:\\blast\\bin\\blastall -p blastn -i $file -d >> $patDB -o $workdir\\blast_$blast_file_id.txt"); > snip > > Just an unrelated note to make your life a little easier, Perl > automagically uses the right directory separator if

Re: call system command

2007-05-15 Thread Chas Owens
On 5/15/07, Dr.Ruud <[EMAIL PROTECTED]> wrote: snip AFAIK, it is not that "Perl automagically uses the right directory separator", but that the shell at hand understands both ways. How does it work with MacOS9? snip I could have sworn that it was, but I just checked perldoc perlport and my memo

error on system command

2001-05-25 Thread Peter Lemus
Hi, I'm getting a syntax error on the following command $PIDS=`ps -ef | grep $user | grep -v grep | cut -b 10-14` Please help. I need to get the process id of $user and assign it to PIDS, then kill it. thanks, = Peter Lemus UNIX/NT Networks Engineer [EMAIL PROTECTED] --This world is too

Re: Perl "system" command

2002-01-22 Thread Jeff 'japhy' Pinyan
On Jan 22, Kevin Kirwan said: >$command=q(/usr/bin/last vtran|head -1|awk '{print $4,$5}'); >$Last=system "$command"; >print $Last; > >This returns the fields that I want, except I also get the return code (0), No. This prints the fields you want when you c

Re: Perl "system" command

2002-01-22 Thread Jenda Krynicky
From: "Kevin Kirwan" <[EMAIL PROTECTED]> > Guys, > I've got a newbie question: I'm writing a Perl program to get some > system information about particular users. The command(s): > $command=q(/usr/bin/last vtran|head -1|awk '{print

Re: Perl "system" command

2002-01-23 Thread Kevin Kirwan
27;m writing a Perl program to get some > > system information about particular users. The command(s): > > $command=q(/usr/bin/last vtran|head -1|awk '{print $4,$5}'); > > $Last=system "$command"; print $Last; > > > > This returns the fields

Running the system command

2002-02-05 Thread Ned Cunningham
What is the proper and best way to use the system command??? System('command'); Or (system 'command'); Please help! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: system command problem

2002-03-15 Thread Curtis Poe
ly the script gets sent a string from an > html form which it then needs to use as part of a system command. This is very dangerous: http://someserver.com/cgi-bin/script.pl?ls%3Brm%20-fr%20%2F%3B With that url, you'll be executing the following: system("/usr/bin/fms_registra

RE: system command problem

2002-03-16 Thread Gavin Nelmes-Crocker [CobaltWorld]
> This is very dangerous: > > http://someserver.com/cgi-bin/script.pl?ls%3Brm%20-fr%20%2F%3B > > With that url, you'll be executing the following: > > system("/usr/bin/fms_registration ls;rm -fr /; /usr/bin/fmserverd"); > Curtis thanks for the pointer I am aware that a few changes need to be

format output from system command

2011-04-14 Thread jet speed
Hi, I need help in formatting ouput from system command, i could'nt figure out a way to format output from system command. appreciate your help with this, the details are below. hlis3 is file with list of clients hosta hostb hostc hostd The below program looks through each client and ou

format output from system command

2011-04-14 Thread jet speed
Hi, I need help in formatting ouput from system command, i could'nt figure out a way to format output from system command. appreciate your help with this, the details are below. hlis3 is file with list of clients hosta hostb hostc hostd The below program looks through each client and ou

Re: redirect system command STDER

2011-07-19 Thread Jim Gibson
On 7/19/11 Tue Jul 19, 2011 12:14 PM, "Tessio Fechine" scribbled: > Hello, > I have a subroutine that uses useradd to create accounts > > -- > @cmd = ('useradd', '-m', $account); > my $result = system @cmd; > -- > > but when useradd fails, I need to stop it from sending the error message to >

Re: redirect system command STDER

2011-07-20 Thread Christian Walde
On Tue, 19 Jul 2011 21:14:10 +0200, Tessio Fechine wrote: Hello, I have a subroutine that uses useradd to create accounts -- @cmd = ('useradd', '-m', $account); my $result = system @cmd; -- but when useradd fails, I need to stop it from sending the error message to STDER. Is it possible with

Re: redirect system command STDER

2011-07-20 Thread Kevin Spencer
On Tue, Jul 19, 2011 at 12:14 PM, Tessio Fechine wrote: > Hello, > I have a subroutine that uses useradd to create accounts > > -- > @cmd = ('useradd', '-m', $account); > my $result = system @cmd; > -- > > but when useradd fails, I need to stop it from sending the error message to > STDER. > Is it

Re: redirect system command STDER

2011-07-20 Thread Shlomi Fish
Hi Jim, On Tue, 19 Jul 2011 16:22:14 -0700 Jim Gibson wrote: > On 7/19/11 Tue Jul 19, 2011 12:14 PM, "Tessio Fechine" > scribbled: > > > Hello, > > I have a subroutine that uses useradd to create accounts > > > > -- > > @cmd = ('useradd', '-m', $account); > > my $result = system @cmd; > > -

Fw: redirect system command STDER

2011-07-20 Thread Shlomi Fish
2911BD47; Wed, 20 Jul 2011 12:42:45 +0300 (IDT) Date: Wed, 20 Jul 2011 12:42:45 +0300 From: Shlomi Fish To: Jim Gibson Cc: Subject: Re: redirect system command STDER Message-ID: <20110720124245.0192b...@telaviv1.shlomifish.org> In-Reply-To: References: X-Mailer: Claws M

Re: redirect system command STDER

2011-07-20 Thread C.DeRykus
On Jul 20, 12:45 am, walde.christ...@googlemail.com ("Christian Walde") wrote: > On Tue, 19 Jul 2011 21:14:10 +0200, Tessio Fechine wrote: > > Hello, > > I have a subroutine that uses useradd to create accounts > > > -- > > @cmd = ('useradd', '-m', $account); > > my $result = system @cmd; > > -- >

Re: Execute newgrp system command

2005-11-21 Thread Shawn Corey
Suvajit Sengupta wrote: Hi, I want to login into a new group using 'newgrp' UNIX command.Every newgrp command invokes a new shell. But when I am trying to execute this system command from a perl script the script is terminating and returning the prompt of the new shell . Can anyone

Re: Execute newgrp system command

2005-11-21 Thread Jay Savage
On 11/21/05, Shawn Corey <[EMAIL PROTECTED]> wrote: > Suvajit Sengupta wrote: > > Hi, > > I want to login into a new group using 'newgrp' UNIX command.Every > > newgrp command invokes a new shell. > > But when I am trying to execute this system c

Re: Execute newgrp system command

2005-11-21 Thread Suvajit Sengupta
/required variables from the current shell. After the newgrp system command from a perl script could not satisfy my need I tried including the command in a separate .cshrc file and then just sourcing that file from a perl script. But this job could not again be executed from perl script . The perl

workaround for unix2dos system command

2001-10-24 Thread Rice, Elizabeth A.
I am modifying a perl script that was originally written for a Solaris platform, where the unix2dos system command is available. The script puts text and filenames into a log file, then runs unix2dos command against the log file, then ships it off as part of a sendmail command. on OS/390 there

Re: Timeout a system command

2002-04-07 Thread victor
Try the alarm function. Tor. Darren Edgerton wrote: > > Hi, > > i want to set a timer around a system command, so that IF the command runs > longer than x seconds > send email to the sysadmin > Note: i *DO NOT* want to kill the process - simply want to send a warnin

Re: Timeout a system command

2002-04-07 Thread Jeff 'japhy' Pinyan
On Apr 8, Darren Edgerton said: >i want to set a timer around a system command, so that IF the command runs >longer than x seconds > >$maxtime=60;# 60 seconds >system("some_command_that_takes_longer_than_60secs"); Here's how I'd do it: { local $

Restart a dead system command

2002-07-15 Thread Kevin Old
my_hostname_here I'm currently calling it with a system command. Several things could happen to the data stream and I'd like to be able to build the error checking so that if the stream is broken it will be reinitialized from the point in time that it was broke, rather than from the beginning o

system command to perl variable

2002-08-13 Thread Jose Malacara
Hello. I was wondering if there is a way to capture a system command into a perl variable. I know this is incorrect, but I basically want to do something like this: $date = system("date"); print "Today is $date."; Thanks, Jose -- To unsubscribe, e-mail: [EMAIL PROTE

Return value from system command.

2004-03-11 Thread Silky Manwani
Hello, Back with the system command but with a different problem. I am calling a program with the system command which has arguments. This program returns a string and I need to capture it. @args("command","arg1","arg2"); $res = system(@args); print $res; It

Re: using the system command

2004-07-01 Thread Wiggins d Anconia
> > I am running perl version 5.8.0 on a Sun Solaris 9.0 machine. > > Given the following bit of code: > use strict; use warnings; > $SOME_FILE = $_; > chomp($SOME_FILE); > $SOME_SAFE_FILE = $SOME_FILE . "_lax"; > system ("cp '$SOME_FILE' '$SOME_SAFE_FILE'"); This is

RE: using the system command

2004-07-01 Thread Adamiec, Larry
> > I am running perl version 5.8.0 on a Sun Solaris 9.0 machine. > > Given the following bit of code: > use strict; use warnings; > $SOME_FILE = $_; > chomp($SOME_FILE); > $SOME_SAFE_FILE = $SOME_FILE . "_lax"; > system ("cp '$SOME_FILE' '$SOME_SAFE_FILE'"); This is

RE: using the system command

2004-07-01 Thread Wiggins d Anconia
> > > > > > I am running perl version 5.8.0 on a Sun Solaris 9.0 machine. > > > > Given the following bit of code: > > > > use strict; > use warnings; > > > $SOME_FILE = $_; > > chomp($SOME_FILE); > > $SOME_SAFE_FILE = $SOME_FILE . "_lax"; > > system ("cp '$SOME_FILE'

Re: using the system command

2004-07-01 Thread John W . Krahn
On Thursday 01 July 2004 11:34, Adamiec, Larry wrote: > > I am running perl version 5.8.0 on a Sun Solaris 9.0 machine. > > Given the following bit of code: > > $SOME_FILE = $_; > chomp($SOME_FILE); > $SOME_SAFE_FILE = $SOME_FILE . "_lax"; > system ("cp '$SOME_FILE' '$SOME_S

RE: using the system command

2004-07-02 Thread Adamiec, Larry
OK. I found the trouble. It had nothing to do with the system command of copying or moving the files. The code snippet below is inside a foreach loop. That foreach loop was inside another foreach loop (don't ask) so I was actually copying the files twice. That is why the files app

error on simple system command

2007-11-26 Thread lerameur
Hello, I am trying to use this two line script. The command by itself works, when I run this script, I get error message: Use of uninitialized value in concatenation (.) or string at ./ find_date.pl line 8. line 8: my $file_to_print = system "ls -lrt /test/*log | tail -1 | awk {'print $9'}";

RE: error on system command

2001-05-25 Thread Peter Cornelius
It might help to know what the error is saying and maybe some surrounding code but my first reaction is that $user has a \n in it that need to be chomped. Also, don't you want @PIDS? Peter C. > Hi, I'm getting a syntax error on the following > command > > $PIDS=`ps -ef | grep $user | grep -v g

Re: error on system command

2001-05-25 Thread Me
> Hi, I'm getting a syntax error on the following > command > > $PIDS=`ps -ef | grep $user | grep -v grep | cut -b > 10-14` You're missing the semi-colon (;) at the end?

Re: error on system command

2001-05-26 Thread Dan Brown
Peter Lemus wrote: > > Hi, I'm getting a syntax error on the following > command > > $PIDS=`ps -ef | grep $user | grep -v grep | cut -b > 10-14` > > Please help. I need to get the process id of $user > and assign it to PIDS, then kill it. This little script worked on my system to prind out th

RE: Running the system command

2002-02-05 Thread Mark Richmond
> -Original Message- > From: Ned Cunningham [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, February 05, 2002 9:49 AM > To: '[EMAIL PROTECTED]' > Subject: Running the system command > > > What is the proper and best way to use the system command???

Re: Running the system command

2002-02-05 Thread KeN ClarK
perldoc -f "system" and it is system("command"); or you could use backticks as in: $now = "the time is now ".`date`; i bet someone will comment about the difference between using system and backticks (don't backticks capture the standard output?) -k

Re: format output from system command

2011-04-15 Thread Shlomi Fish
Hi jet speed, On Friday 15 Apr 2011 00:23:17 jet speed wrote: > Hi, > > I need help in formatting ouput from system command, i could'nt figure out > a way to format output from system command. appreciate your help with > this, the details are below. > > hlis3 is

Re: format output from system command

2011-04-15 Thread sono-io
On Apr 15, 2011, at 2:11 AM, Shlomi Fish wrote: > 1. Don't use bareword file-handles. > > 2. Use the three-args open: > > open (my $file_our, '>>', 'cmdout') or die "Cannot open cmdout: $!"; What about writing it like this: open ('FILEOUT', '>>', 'cmdout') ||die "cant open cmdout: $! \

Re: format output from system command

2011-04-15 Thread Alan Haggai Alavi
Hello Marc, What about writing it like this: open ('FILEOUT', '>>', 'cmdout') ||die "cant open cmdout: $! \n"; Is that O.K.? You are still using a bareword filehandle. Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e-mail: beginners-un

Re: format output from system command

2011-04-15 Thread sono-io
On Apr 15, 2011, at 8:37 AM, Alan Haggai Alavi wrote: >> open ('FILEOUT', '>>', 'cmdout') ||die "cant open cmdout: $! \n"; >> >> Is that O.K.? > > You are still using a bareword filehandle. Putting single quotes around the filehandle allows it to pass Perl Critic, so I was just cu

Re: format output from system command

2011-04-15 Thread Shawn H Corey
On 11-04-15 11:22 AM, sono...@fannullone.us wrote: open ('FILEOUT', '>>', 'cmdout') ||die "cant open cmdout: $! \n"; Is that O.K.? The problem with not using lexical-scoped file handles is that if a module opens a file using the same name, it closes yours. It's best if you limit the

Re: format output from system command

2011-04-16 Thread Peter Scott
On Fri, 15 Apr 2011 08:53:12 -0700, sono-io wrote: > On Apr 15, 2011, at 8:37 AM, Alan Haggai Alavi wrote: > >>> open ('FILEOUT', '>>', 'cmdout') ||die "cant open cmdout: $! \n"; >>> >>> Is that O.K.? >> >> You are still using a bareword filehandle. > > Putting single quotes around t

Problem with variable in system command

2002-10-10 Thread Anthony . Kernan
I've written a script to search for all *.pid files in a dir, then do a cat on the file. The script will then use this variable to kill the process. The problem I'm having is that the varibale is not being read correctly. I run the script and the kill process tries to run without the variable.

Problem with the Perl System command

2003-10-06 Thread Chinku Simon
Hi, I am facing an issue with the perl system command The relevant lines of code are the following: chdir "$util"; my @args = ("ldapmodify", "-D \"cn=$bdn\"", "-w $bp", "-h $svr", "-f \"$ldif\"", "-c", &q

Re: error on simple system command

2007-11-27 Thread lerameur
works good now: my $file_to_print = ( `ls -1c /test/*log | tail -1 `); print "file_to_print: $file_to_print"; open (FILE, "< /test/$file_to_print") or die "Could not open file_to_print $: $!"; although the third line is not opening the file. It prints out good but but I

Re: error on simple system command

2007-11-27 Thread John W . Krahn
On Tuesday 27 November 2007 08:18, lerameur wrote: > > works good now: > my $file_to_print = ( `ls -1c /test/*log | tail -1 `); > > print "file_to_print: $file_to_print"; > > open (FILE, "< /test/$file_to_print") or die "Could not open > file_to_print $: $!"; > > although the thi

Re: error on simple system command

2007-11-27 Thread Tom Phoenix
On 11/27/07, lerameur <[EMAIL PROTECTED]> wrote: > works good now: > my $file_to_print = ( `ls -1c /test/*log | tail -1 `); > > print "file_to_print: $file_to_print"; Since you didn't chomp() it, and since you didn't need to add a newline when you printed it, it seems that $file_

Re: workaround for unix2dos system command

2001-10-25 Thread RaFaL Pocztarski
"Rice, Elizabeth A." wrote: > on OS/390 there is no unix2dos command available. So, if I use the file as > is, it is sent in the email but it comes out with no carriage returns, etc., > making the file unreadable when it is of any significant size. You can use a simple oneliner in Perl to conve

Re: workaround for unix2dos system command

2001-10-25 Thread Rice, Elizabeth A.
>> on OS/390 there is no unix2dos command available. So, if I use the file as >> is, it is sent in the email but it comes out with no carriage returns, etc., >> making the file unreadable when it is of any significant size. >You can use a simple oneliner in Perl to convert text files see >htt

Re: workaround for unix2dos system command

2001-10-25 Thread Jeff 'japhy' Pinyan
On Oct 25, Rice, Elizabeth A. said: >2- I get "Illegal Hexadecimal Digit '\' ignored" against the line that has >the regex. If I change the regexto s/\xa/\xda/g > then I no longer get this error, but still no output is given. This is >on OS/390 Unix. I'm not sure if EBCDIC is messing

running system command on another host

2002-05-10 Thread Simon K. Chan
Hi All, I've never tried something like this before, so my apologies if it's "easy" We all know about the system command: my $program = "some_script.pl"; system("perl",$program); This would execute the program some_script.pl on the current host.

Re: system command to perl variable

2002-08-13 Thread Sudarshan Raghavan
On Wed, 14 Aug 2002, Jose Malacara wrote: > Hello. I was wondering if there is a way to capture a system command into a > perl variable. I know this is incorrect, but I basically want to do something > like this: > > $date = system("date"); > print "Today i

RE: Return value from system command.

2004-03-11 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Silky Manwani wrote: > Hello, > > Back with the system command but with a different problem. > > I am calling a program with the system command which has arguments. > This program returns a string and I need to capture it. > > @args("command","arg1"

Re: Return value from system command.

2004-03-11 Thread John W. Krahn
Silky Manwani wrote: > > Hello, Hello, > Back with the system command but with a different problem. > > I am calling a program with the system command which has arguments. > This program returns a string and I need to capture it. > > @args("command",&qu

Re: Return value from system command.

2004-03-11 Thread Silky Manwani
Bingo! Got it... Thanks John and David. :) On Mar 11, 2004, at 4:38 PM, John W. Krahn wrote: Silky Manwani wrote: Hello, Hello, Back with the system command but with a different problem. I am calling a program with the system command which has arguments. This program returns a string and I

RE: Secure Shell and system command

2004-08-30 Thread u235sentinel
I would run system commands with the backticks. That tells Perl to run the command and place the contents in the variable you defined. System OTOH returns if the command completed successfully (at least I believe that's what happened here). > Moon, John wrote: > > Hello, > > > I run the fol

system() command with a time limit

2006-12-24 Thread Kelly Jones
I want to use system() (or `command`) to run an external command from my Perl script. However, if the external command takes more than 30 seconds (for example) to run, I want to kill it, and move on with the rest of my Perl script. How do I do this? -- We're just a Bunch Of Regular Guys, a collec

Re: error on simple system command

2007-11-26 Thread John W . Krahn
On Monday 26 November 2007 13:05, lerameur wrote: > Hello, Hello, > I am trying to use this two line script. The command by itself works, > when I run this script, I get error message: > Use of uninitialized value in concatenation (.) or string at ./ > find_date.pl line 8. > > line 8: my $file_t

Re: error on simple system command

2007-11-26 Thread Jenda Krynicky
To: beginners@perl.org From: lerameur <[EMAIL PROTECTED]> Subject:error on simple system command Date sent: Mon, 26 Nov 2007 13:05:53 -0800 (PST) Organization: http://groups.google.com > Hello, > > I a

  1   2   >