Re: system command not working in different versions

2012-08-09 Thread Shawn H Corey
On Thu, 9 Aug 2012 12:20:33 + Bob McConnell wrote: > My first step would be to log into the problem machine as the same > user the command runs under, then try to run it manually. The error > messages there should point you toward the problem. If it runs, then > there has to be a difference i

RE: system command not working in different versions

2012-08-09 Thread Bob McConnell
> From: Shawn H Corey > > On Thu, 9 Aug 2012 15:17:57 +0800 (SGT) > venki neeli wrote: > > > What may be the problem? is it with version of perl? or perl module > > problem? > > It may be a difference in the shell. When there are metacharacters > present, system uses sh(1) to interpret them. Tr

Re: system command not working in different versions

2012-08-09 Thread Shawn H Corey
On Thu, 9 Aug 2012 15:17:57 +0800 (SGT) venki neeli wrote: > What may be the problem? is it with version of perl? or perl module > problem? It may be a difference in the shell. When there are metacharacters present, system uses sh(1) to interpret them. Try this on your machines to see if they're

Re: system command not working in different versions

2012-08-09 Thread Paul Anderson
> > From: midhun > To: Hal Wigoda > Cc: venki neeli ; perl list > Sent: Thursday, 9 August 2012 12:01 PM > Subject: Re: system command not working in different versions > > Neeli, Hal is right. Try $which perl from your shell. The location

Re: system command not working in different versions

2012-08-09 Thread venki neeli
roblem? is it with version of perl? or perl module problem? Regards, Neeli From: midhun To: Hal Wigoda Cc: venki neeli ; perl list Sent: Thursday, 9 August 2012 12:01 PM Subject: Re: system command not working in different versions Neeli, Hal is right.

Re: system command not working in different versions

2012-08-08 Thread midhun
> > > > > From: midhun > > To: venki neeli > > Cc: perl list > > Sent: Wednesday, 8 August 2012 3:55 PM > > Subject: Re: system command not working in different versions > > > > One suggestion. Did you compare

Re: system command not working in different versions

2012-08-08 Thread Hal Wigoda
ow.pl) are in same location. > > Regards, > Neeli > > > > From: midhun > To: venki neeli > Cc: perl list > Sent: Wednesday, 8 August 2012 3:55 PM > Subject: Re: system command not working in different versions > > One suggestion. Did

Re: system command not working in different versions

2012-08-08 Thread Owen
> From: midhun > To: venki neeli > Cc: perl list > Sent: Wednesday, 8 August 2012 3:55 PM > Subject: Re: system command not working in different versions > > One suggestion. Did you compare the shebang line of your submit_now.pl > and > your perl executable loca

Re: system command not working in different versions

2012-08-08 Thread venki neeli
August 2012 3:55 PM Subject: Re: system command not working in different versions One suggestion. Did you compare the shebang line of your submit_now.pl and your perl executable location in the 2nd machine where it is not working. Regards, Midhun On Wed, Aug 8, 2012 at 11:48 AM, venki neeli

Re: system command not working in different versions

2012-08-08 Thread Shawn H Corey
On Wed, 8 Aug 2012 15:55:34 +0530 midhun wrote: > One suggestion. Did you compare the shebang line of your > submit_now.pl and your perl executable location in the 2nd machine > where it is not working. > > Regards, > Midhun > > On Wed, Aug 8, 2012 at 11:48 AM, venki neeli > wrote: > > > Dear

Re: system command not working in different versions

2012-08-08 Thread midhun
One suggestion. Did you compare the shebang line of your submit_now.pl and your perl executable location in the 2nd machine where it is not working. Regards, Midhun On Wed, Aug 8, 2012 at 11:48 AM, venki neeli wrote: > Dear Friends, > > I am developing a script in which I need to call another pe

Re: system command not working in different versions

2012-08-07 Thread Jeff Pang
You might want to tell us what's the output for error. Some reasons include the file path, the permissions etc. I am developing a script in which I need to call another perl script. In one linux machine it is working and in the other machine it is not working. Ex:- system("./submit_now.pl $xx

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 run, > some environment var

Re: system vs. backticks

2010-06-10 Thread pauldkline
The solution is to open a shell script with a pipe and send it the commands to be executed. That way no new shell is opened for each command and McAfee is quiet: # open shell with pipe and turn off buffering open (OPSH, "|-") or exec ("./my.sh 01 >opsh1.log 2>&1"); $savefh

Re: system vs. backticks

2010-05-19 Thread Rob Coops
On Tue, May 18, 2010 at 11:23 PM, Dr.Ruud > wrote: > pauldkl...@aol.com wrote: > >> I have a perl script that calls a compiled c program and retrieves the >> output lines hundreds of times a minute, and want to make it as >> efficient as possible. This is on Windows XP and ActivePerl 5.8. >> >>

Re: system vs. backticks

2010-05-19 Thread Dr.Ruud
pauldkl...@aol.com wrote: I have a perl script that calls a compiled c program and retrieves the output lines hundreds of times a minute, and want to make it as efficient as possible. This is on Windows XP and ActivePerl 5.8. Using 'system' and redirecting stdout to a file, then opening and rea

Re: system() call in END() subroutine overrides script exit value

2010-05-17 Thread Marilyn Sander
I On May 17, 2010, at 11:21 AM, John W. Krahn wrote: > John W. Krahn wrote: >> Kelly Jones wrote: >>> I did this in tcsh: >>> perl -le 'exit(2); sub END {system("date");}' ; echo $status >>> Mon May 17 11:09:43 MDT 2010 >>> 0 >>> >>> In other words, the return value of the date command in

Re: system() call in END() subroutine overrides script exit value

2010-05-17 Thread John W. Krahn
John W. Krahn wrote: Kelly Jones wrote: I did this in tcsh: perl -le 'exit(2); sub END {system("date");}' ; echo $status Mon May 17 11:09:43 MDT 2010 0 In other words, the return value of the date command in an END subroutine overrides my desired exit value. How do I fix this? I want to tel

Re: system() call in END() subroutine overrides script exit value

2010-05-17 Thread Paul Johnson
On Mon, May 17, 2010 at 11:54:32AM -0600, Kelly Jones wrote: > I did this in tcsh: > > > perl -le 'exit(2); sub END {system("date");}' ; echo $status > Mon May 17 11:09:43 MDT 2010 > 0 > > In other words, the return value of the date command in an END subroutine > overrides my desired exit value.

Re: system() call in END() subroutine overrides script exit value

2010-05-17 Thread John W. Krahn
Kelly Jones wrote: I did this in tcsh: perl -le 'exit(2); sub END {system("date");}' ; echo $status Mon May 17 11:09:43 MDT 2010 0 In other words, the return value of the date command in an END subroutine overrides my desired exit value. How do I fix this? I want to tell Perl: if I explicitl

Re: System question

2010-01-14 Thread Jeremiah Foster
On Jan 14, 2010, at 12:43 AM, Jim Gibson wrote: > On 1/13/10 Wed Jan 13, 2010 3:28 PM, "ANJAN PURKAYASTHA" > scribbled: > >> Hi, >> Suppose I run an application from within a perl script, with system (eg >> system ("myfavprogram input_file out_file")). >> Is there a way to let the script know

Re: System question

2010-01-13 Thread Jim Gibson
On 1/13/10 Wed Jan 13, 2010 3:28 PM, "ANJAN PURKAYASTHA" scribbled: > Hi, > Suppose I run an application from within a perl script, with system (eg > system ("myfavprogram input_file out_file")). > Is there a way to let the script know that the program has finished running > and that I can mov

Re: system("cd /home/tomer/temp") problem

2009-01-28 Thread Raymond Wan
Hi Tomer, tomer wrote: after exectue the command system("cd /home/tomer/temp") I dont see the terminal change the direcotry? maybe the change is valid only in the script? how can i control "seeing" terminal direcotry with perl script ? system might not be what you want. What it does is tha

Re: system -> $variable

2008-11-29 Thread John W. Krahn
David wrote: I am trying to get 081129 into $dayStamp. #!/usr/bin/perl -w use strict; my $dayStamp; $dayStamp = `date +\'%y%m%d\'` && die "Failure!"; You have three problems with that statement: 1) The '=' operator has higher precedence than the '&&' operator so you need to either enclose

Re: system -> $variable

2008-11-29 Thread Chas. Owens
On Sat, Nov 29, 2008 at 21:25, David <[EMAIL PROTECTED]> wrote: > I am trying to get 081129 into $dayStamp. > > #!/usr/bin/perl -w > use strict; > my $dayStamp; > $dayStamp = `date +\'%y%m%d\'` && die "Failure!"; > print "$dayStamp\n"; > > > My program outputs: > Failure! at /Users/dave/perl/dateLo

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

Re: system command

2008-11-26 Thread Deviloper
It will wait. This behaviour is called "blocking". If you want to just start it and the go on in your code "non-blocking" or If you want to do some tasks "at the same time", you should take a look at fork, threads or easier Proc::ParallelLoop. But If the bottleneck is your computingpower, this wi

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, > > > > I am trying to launch a program using system command. > > The program usually take

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 then proceed > to the

Re: System Call Help

2008-07-25 Thread masterpoet
On Jul 24, 7:39 pm, [EMAIL PROTECTED] (Peng Kyo) wrote: > On Fri, Jul 25, 2008 at 3:22 AM, <[EMAIL PROTECTED]> wrote: > > Greets Guys > > > Trying to Make a system from perl to use the sort. > > > # @args = ('c:\windows\system32\sort.exe "C\logs\"'); > > # system(@args) == 0 > > # or

Re: System Call Help

2008-07-24 Thread peng . kyo
On Fri, Jul 25, 2008 at 3:22 AM, <[EMAIL PROTECTED]> wrote: > Greets Guys > > > Trying to Make a system from perl to use the sort. > > > > # @args = ('c:\windows\system32\sort.exe "C\logs\"'); > # system(@args) == 0 > # or die "system @args failed:$?" > rather than calling an externa

Re: system()

2008-05-19 Thread John W. Krahn
schms wrote: I am trying to run the following system() command. It seems as Perl is not able to handover $POLICYNAME to the Unix shell It *looks* like you are trying to hand over $POLICYNAME to /usr/openv/netbackup/bin/admincmd/bpplinfo and not to the shell. Whether or not system() invokes a

Re: system()

2008-05-19 Thread Chas. Owens
On Mon, May 19, 2008 at 6:21 AM, schms <[EMAIL PROTECTED]> wrote: snip > while () { snip you need a chomp here snip >my $POLICYNAME = $_; > >my @args = ("/usr/openv/netbackup/bin/admincmd/bpplinfo > $POLICYNAME -modify -inactive"); snip this is a pointless use of an array with on

Re: !system and output

2008-04-07 Thread Chas. Owens
On Mon, Apr 7, 2008 at 11:26 AM, Kevin Viel <[EMAIL PROTECTED]> wrote: snip > The results of phymap my be several lines of text. I would like to process > these lines in perl snip You have several options the qx// operator*, open**, IPC::Open2***, and IPC::Open3. The qx// operator is the e

Re: !system and output

2008-04-07 Thread Mr. Shawn H. Corey
On Mon, 2008-04-07 at 10:26 -0500, Kevin Viel wrote: > On my Solaris box, I have a perl program that calls a second program via > !system: > > my $sys = !system "phymap" ; Actually this statement is read as: my $sys = ! (system "phymap"); The NOT operator is applied to returned value of the s

Re: system calls return code

2008-03-27 Thread ultra . star . x
Thank you very much for explaining. I will try what Sandy suggested. I had tested at the command line already just as Jeff did. The confusion came from the fact that I had tried it in csh and in csh, doing the "ls |xargs cat" returned 1. Annoying. C. -- To unsubscribe, e-mail: [EMAIL PROTEC

Re: system calls return code

2008-03-27 Thread Sandy
On 27 мар, 03:50, [EMAIL PROTECTED] (Ultra Star X) wrote: > I am really going crazy here. I have the following system call that I > would like to run from perl: > "ls *.txt | xargs cat > out" > if *.txt does not exist then I expect to get an exit code different > from 0. > > So to test I do: > >

Re: system calls return code

2008-03-27 Thread Jeff Pang
This is because you send ls's output to a pipe, and the command on the right of the pipe get executed successfully. Try this test on shell: -bash-3.00$ ls |xargs cat ls: : No such file or directory -bash-3.00$ echo $? 0 -bash-3.00$ ls ls: : No such file or directory -bash-3.00$ ec

Re: system ("find...") - escape character help

2008-02-11 Thread Pad
> I'm pretty sure all sane user and admin tools forbid this, > although if you edit /etc/passwd (shadow?) directly, you deserve > your BOFH award. :) Thanks everyone for your input and i used successfully chown/chmod in my routines as provided by John Krahn. Yes, it is username and not the uid!!

Re: system ("find...") - escape character help

2008-02-09 Thread Randal L. Schwartz
> ""John" == "John W Krahn" <[EMAIL PROTECTED]> writes: >>> # If 29334 is the user *name* and not the UID >>> # then do this instead: >>> #return if getpwuid( $uid ) ne '29334'; If you have a strictly numeric username, life will be a real pain. I'm pretty sure all sane user and admin tools f

Re: system ("find...") - escape character help

2008-02-08 Thread John W. Krahn
Pad wrote: On Feb 8, 6:24 am, [EMAIL PROTECTED] (John W. Krahn) wrote: This may work better (UNTESTED): #!/bin/perl use warnings; use strict; use File::Find; my $tagname = 'XYZ'; my $user= getpwnam 'orauser'; my $seq = '01'; find sub { my ( $uid, $gid ) = ( lstat )[ 4, 5 ];

Re: system ("find...") - escape character help

2008-02-08 Thread Tom Phoenix
On Feb 8, 2008 12:52 PM, Pad <[EMAIL PROTECTED]> wrote: > Can you pl.help me how to get chmod cmd that I am trying to set run > on those directories. I was thinking of using system (" find ... - > exec chmod 755 {} \; ") So, does Perl's chmod() function work for you? You should be able to us

Re: system ("find...") - escape character help

2008-02-08 Thread Pad
Thank you so much.. That was helpful. I feel it looks more perl like solution than calling unix OS cmd. Can you pl.help me how to get chmod cmd that I am trying to set run on those directories. I was thinking of using system (" find ... - exec chmod 755 {} \; ") pad On Feb 8, 6:24 am, [E

Re: system ("find...") - escape character help

2008-02-08 Thread John W. Krahn
Pad wrote: In my script, I am trying to use find cmd (Solaris 8 OS) to change the permission and ownership of a file. I don't know how to get it working as I get 'find incomplete statement'. To make things simpler, here is a small modified snippet of my code.. #!/bin/perl use warnings; my $t

Re: system sudo and backslashing #

2007-11-17 Thread Tom Phoenix
On 11/16/07, R (Chandra) Chandrasekhar <[EMAIL PROTECTED]> wrote: > This is a Linux-oriented question. Then why would you ask it in a Perl-oriented forum? It would seem, from your opening, that you should be asking in a Linux-oriented forum. (But you do have a Perl question, after all.) > system

Re: system sudo and backslashing #

2007-11-17 Thread Rob Dixon
R (Chandra) Chandrasekhar wrote: This is a Linux-oriented question. [snip] I'm sorry, we answer only Perl-orientated questions on this list :) Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: system() function not executing scripts

2007-10-12 Thread Jeff Pang
Are you running a redirector for squid?Where do you put these scripts?Does Squid has privileges to access the scripts dir and run the scripts?What did you see in cache.log? the last,if you can post some codes here,it should be more helpful. 2007/10/12, Gregory Machin <[EMAIL PROTECTED]>: > Hi > I'

Re: System

2007-09-22 Thread Chris Charley
- Original Message - From: "Somu" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Friday, September 21, 2007 11:27 AM Subject: System About that PID problem, i found a program in Windows named tasklist, it prints all the processes running on the system with its id. I used t

Re: System

2007-09-22 Thread Gunnar Hjalmarsson
Somu wrote: About that PID problem, i found a program in Windows named tasklist, it prints all the processes running on the system with its id. I used the system command to execute the tasklist, like as my $data = system "tasklist" ; but i got nothing in $data. How can i get the data from the s

RE: System

2007-09-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Somu [mailto:[EMAIL PROTECTED] > Sent: Friday, September 21, 2007 08:27 > To: Beginners@perl.org > Subject: System > > About that PID problem, i found a program in Windows named tasklist, > it prints all the processes running on the system with its id. I used

Re: System call returning Bad file Descriptor

2007-08-14 Thread Chas Owens
On 8/14/07, Darnelle Roby <[EMAIL PROTECTED]> wrote: snip > Once we call the script using an Oracle forms Host call the script returns an > error in the log file of "Bad file descriptor". snip > if (system("ghostscript -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite snip It sounds like ghostscript is getti

Re: System call

2007-04-10 Thread Tom Phoenix
On 4/10/07, Nath, Alok (STSD) <[EMAIL PROTECTED]> wrote: Can somebody explain the difference between this 2 system calls ? system "grep 'fred flint' buff" This one asks the shell (/bin/sh) to run the command "grep 'fred flint' buff". system "grep", "fred flint", "buff" This one asks

Re: system and list of arguments

2007-02-21 Thread Dr.Ruud
Mathew Snyder schreef: > system("shredder","--force","--plugin" > "Tickets=arg1,desc;arg2,desc;arg3,desc") Alternative: system qw/shredder --force --plugin/ , q/Tickets=arg1,desc;arg2,desc;arg3,desc/; Variant: { no warnings q/qw/; system qw/shredder --force --plugin Tickets=arg

Re: system and list of arguments

2007-02-20 Thread Mathew Snyder
Tom Phoenix wrote: > On 2/20/07, Mathew Snyder <[EMAIL PROTECTED]> wrote: > >> shredder --force --plugin 'Tickets=arg1,desc;arg2,desc;arg3,desc' >> >> I can see that the system call would look like >> system("shredder","--force","--plugin" >> for the first section there, however, would the last pa

Re: system and list of arguments

2007-02-20 Thread Tom Phoenix
On 2/20/07, Mathew Snyder <[EMAIL PROTECTED]> wrote: shredder --force --plugin 'Tickets=arg1,desc;arg2,desc;arg3,desc' I can see that the system call would look like system("shredder","--force","--plugin" for the first section there, however, would the last part be "\'Tickets==arg1,desc;arg2,de

Re: system()

2007-02-16 Thread Mumia W.
On 02/16/2007 07:25 PM, Jeff Pang wrote: The command "perldoc -f open" shows you how to do get the output from a command without starting a shell. Do you mean open a pipe? It still need to fork a child process for running the external commands. Read the "safe pipe opens" section of "perld

Re: system()

2007-02-16 Thread Jeff Pang
>The command "perldoc -f open" shows you how to do get the output from a >command without starting a shell. > Do you mean open a pipe? It still need to fork a child process for running the external commands. -- 祝所有中华Perl用户新春快乐! Happy New Year for all Chinese Perl guys! -- To unsubscribe, e-ma

Re: system()

2007-02-16 Thread Mumia W.
On 02/16/2007 07:58 AM, Doroshok Stanislav wrote: hi all I need output from system(): @rrd = ("/usr/bin/rrdtool","graph","-","--title","hypergraph",); $rezult = system(@rrd); how can i get output? p.s. i don't wont use `` and run shell; thanks The command "perldoc -f open" show

Re: system()

2007-02-16 Thread Jeff Pang
>p.s. i don't wont use `` and run shell; Why don't ue ``? system() call would also fork a child process to do the things,as `` do. -- Jeff Pang EMAIL: [EMAIL PROTECTED] AIM: jeffpang -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.

Re: % System Question

2007-01-10 Thread Mumia W.
On 01/10/2007 04:20 PM, Guerrero, Citlali (GE, Corporate, consultant) wrote: Hi all : Does anyone knows how to catch the error standard from a call to system? I mean something like this: use strict; use warnings; pritn "Calling the second script : \n"; system("perl hi_all.pl") exit; if th

Re: % System Question

2007-01-10 Thread John W. Krahn
Guerrero, Citlali (GE, Corporate, consultant) wrote: > Hi all : Hello, > Does anyone knows how to catch the error standard from a call to system? perldoc -q stderr John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in shor

Re: system() command with a time limit

2006-12-24 Thread Jeff Pang
Using eval. eval { local $SIG{ALRM} = sub {die "something is wrong"}; alarm 30; do_something... alarm 0; }; if ($@) { handle_for_the_errors(); } -Original Message- >From: Kelly Jones <[EMAIL PRO

Re: system call issues

2006-09-21 Thread John W. Krahn
Saurabh Singhvi wrote: > Hi all, Hello, > The following code block > > foreach $protein (@pdbs) { >$rmsd[$i] = 0; >foreach $protein2 (@pdbs2) { >system("./TMalign $protein $protein2 | cgrep -i rmsd > What is cgrep? I don't have that on my system. > temp") == 0

Re: system call issues

2006-09-21 Thread Saurabh Singhvi
Hi, I am sorry about the above, it was a part of the complete code. I was using warnings but not strict. Also, the OS is gentoo and fs was reiser4/ ext3, with same results. Your method kind of works, but a lot of warnings are being thrown up. The main ones being : Use of uninitialized value in

Re: system call issues

2006-09-21 Thread Mumia W.
On 09/21/06 07:30, Mumia W. wrote: Try the open command I wrote, and see if that works. I hope this helps. s/open command/code/ No I didn't write the open command ;-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <

Re: system call issues

2006-09-21 Thread Mumia W.
On 09/21/2006 04:52 AM, Saurabh Singhvi wrote: Hi all, The following code block is written without strictures and warnings enabled. If you place these lines, use strict; use warnings; at the top of your program, you'll catch errors much more quickly. In particular, "use strict" will fo

Re: System call for openssl

2005-11-10 Thread Pete Emerson
If you don't specify -out the openssl command (I think, untested) will spit the results to STDOUT, in which case you could do this: $results = `openssl smime smime -sign -outform der -nodetach -signer $certificate -in $encoded`; and then you probably want to chomp $results, or parse them in

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.

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-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 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 ("cd ..")

2005-08-30 Thread Chris Devers
On Mon, 29 Aug 2005, Eliyah Kilada wrote: > - I agree with [you] that a shell script is more appropriate, but how > can I write regular expressions in this way ? ;-) By typing them, naturally :-) In shell scripts, grep, sed & awk are the common regex using tools; depending on what you're doing

Re: system ("cd ..")

2005-08-30 Thread David
I'm not sure, but putting a ; between the commands might work: system "cd ..; pwd" On Mon, 2005-08-29 at 18:06 +0300, Eliyah Kilada wrote: > Hi, > - I agree with u that a shell script is more appropriate, but how I can > write regular expressions in this way ? ;-) > > Regards, > Eliyah > > >

Re: system ("cd ..")

2005-08-29 Thread Eliyah Kilada
Hi, - I agree with u that a shell script is more appropriate, but how I can write regular expressions in this way ? ;-) Regards, Eliyah Jeff 'japhy' Pinyan wrote: On Aug 29, Eliyah Kilada said: How can I access a specific child process, such that I put all my system commands in one chil

Re: system ("cd ..")

2005-08-29 Thread Jeff 'japhy' Pinyan
On Aug 29, Eliyah Kilada said: How can I access a specific child process, such that I put all my system commands in one child process? It sounds like you want a shell script rather than a Perl program. Or, perhaps you should figure out how to do things via Perl rather than calling the shell

Re: system ("cd ..")

2005-08-29 Thread Eliyah Kilada
Hi, How can I access a specific child process, such that I put all my system commands in one child process? Thanks alot Eliyah Bob Showalter wrote: Eliyah Kilada wrote: Hi, It seems that the following code gives unexpected results: system ("cd $dir_name"); system ("pwd"); ---> this pri

RE: system ("cd ..")

2005-08-29 Thread Bob Showalter
Eliyah Kilada wrote: > Hi, > It seems that the following code gives unexpected results: > > system ("cd $dir_name"); > system ("pwd"); > ---> this prints the old directory name not the new one. In other > words, the previous (cd) command hasn't taken its effect! > Do anyone know why? Each call to

Re: System, shell question

2005-08-26 Thread John W. Krahn
steve tran wrote: > Hello Hello, > I am a beginner to perl and I have a question > > if I want to use system or open or backticks to > execute a system command, > like system("$cmd arg1"); ( with system for instance) > > and the $cmd which is a prog takes another program > called in arg1 , a

Re: System, shell question

2005-08-26 Thread Binish A R
steve tran wrote: Hello I am a beginner to perl and I have a question if I want to use system or open or backticks to execute a system command, like system("$cmd arg1"); ( with system for instance) and the $cmd which is a prog takes another program called in arg1 , and that program(arg

Re: system v backticks

2005-07-27 Thread Jeff 'japhy' Pinyan
On Jul 28, Keenan, Greg John (Greg)** CTR ** said: sub getDate { print "start date\n"; if ( system("/bin/date") ) { print "can't get date\n"; exit(2); } print "finish date\n"; } system() executes a command, and returns the shell's error code. 0 indicates success, non-0 indicates failure.

Re: system v backticks

2005-07-27 Thread Wiggins d'Anconia
Keenan, Greg John (Greg)** CTR ** wrote: > Hi, > > Can someone explain the difference between backticks and system when > evaluated in this if statement: > The difference really isn't specific to this context, it is the inherent difference between the two that is affecting the outcome. perldoc -

Re: system trouble

2005-04-11 Thread Jan Eden
Robin wrote on 12.04.2005: >On Tuesday 12 April 2005 00:31, Jan Eden wrote: >> system ("webalizer", "-c ./webalizer.conf", >> "/Users/jan/Sites/apache_logs/$file"); } >> } >> closedir(DIR); >> >> webalizer complains that it cannot find the configuration file >> (provided via the -c paramet

Re: system trouble

2005-04-11 Thread Robin
On Tuesday 12 April 2005 00:31, Jan Eden wrote: > system ("webalizer", "-c ./webalizer.conf", > "/Users/jan/Sites/apache_logs/$file"); } > } > closedir(DIR); > > webalizer complains that it cannot find the configuration file > (provided via the -c parameter). Try: system ("webalizer", "-c",

RE: System o/p to a varaible

2005-03-15 Thread Manav Mathur
-Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 16, 2005 12:06 AM To: Perl Beginners List Cc: Anish Kumar K. Subject: Re: System o/p to a varaible On Mar 15, Chris Devers said: >system($command) >or die "

Re: System o/p to a varaible

2005-03-15 Thread John W. Krahn
Anish Kumar K. wrote: Hi Hello, This program I use to get the last line from the log file "cipe.log". and then write the line onto a text file "a.txt" system("tail -1 cipe.log > a.txt"); open INPUT,"a.txt"; my $line=; then I open the text file and read the value from the file handle. This invloves

Re: System o/p to a varaible

2005-03-15 Thread Chris Devers
On Tue, 15 Mar 2005, Jeff 'japhy' Pinyan wrote: > On Mar 15, Chris Devers said: > > >system($command) > >or die "Couldn't run command '$command': $!"; > > That needs to be > > system($command) == 0 > or die ...; ...which is all the more reason to avoid the system command :-)

Re: System o/p to a varaible

2005-03-15 Thread Jeff 'japhy' Pinyan
On Mar 15, Chris Devers said: system($command) or die "Couldn't run command '$command': $!"; That needs to be system($command) == 0 or die ...; -- Jeff "japhy" Pinyan % How can we ever be the sold short or RPI Acacia Brother #734 % the cheated, we who for every service

Re: System o/p to a varaible

2005-03-15 Thread Felix Geerinckx
[EMAIL PROTECTED] (Anish Kumar K.) wrote in news:[EMAIL PROTECTED]: > system("tail -1 cipe.log > a.txt"); > open INPUT,"a.txt"; > my $line=; my $line = qx(tail -1 cipe.log); -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: System o/p to a varaible

2005-03-15 Thread Bob Showalter
Anish Kumar K. wrote: > Hi > > This program I use to get the last line from the log file "cipe.log". > and then write the line onto a text file "a.txt" > > system("tail -1 cipe.log > a.txt"); > open INPUT,"a.txt"; > my $line=; > > then I open the text file and read the value from the file handl

Re: System o/p to a varaible

2005-03-15 Thread Chris Devers
On Tue, 15 Mar 2005, Anish Kumar K. wrote: > This program I use to get the last line from the log file "cipe.log". > and then write the line onto a text file "a.txt" > > system("tail -1 cipe.log > a.txt"); > open INPUT,"a.txt"; > my $line=; > > then I open the text file and read the value from

Re: System o/p to a varaible

2005-03-15 Thread John Doe
Am Dienstag, 15. März 2005 01.33 schrieb Anish Kumar K.: > Hi > > This program I use to get the last line from the log file "cipe.log". and > then write the line onto a text file "a.txt" > > system("tail -1 cipe.log > a.txt"); > open INPUT,"a.txt"; > my $line=; > > then I open the text file and rea

Re: System or Backticks?

2004-09-02 Thread Wiggins d Anconia
> Hi all, > > Still thinking about this one. I have: > > my $backup = system($rdiff, @args); > > # Send e-mail with a few details for success and failures > # Success > if ($backup == 0) { > blah > } > > > I want to be able to stick the ouput of the $rdiff command into a strong, > as well as g

Re: System or Backticks? - Don't reply, searched archives :-)

2004-09-02 Thread Gavin Henry
Sorry, this has been asked a million times, as I just foun din the archives and perlmonk. Don't bother replying :-) Gavin. -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: system call

2004-08-27 Thread Wiggins d Anconia
don't translate to "fact" ... just ask Microsoft. http://danconia.org > > > "Wiggins d Anconia" <[EMAIL PROTECTED]> > 08/27/2004 05:18 PM > > > To: [EMAIL PROTECTED], "Wiggins d Anconia" <[EMAIL PROTECTED]>, > [EMAIL PRO

Re: system call

2004-08-27 Thread DBSMITH
ia" <[EMAIL PROTECTED]>, [EMAIL PROTECTED] cc: Subject:Re: system call Please bottom post > > yes I do understand but it is not working. You need to tell us that originally, we are not mind readers. In other words when cat > /tmp/foo fails the

Re: system call

2004-08-27 Thread Wiggins d Anconia
mean, if anything. http://danconia.org > > thank you , > Derek B. Smith > OhioHealth IT > UNIX / TSM / EDM Teams > > > > > > > "Wiggins d Anconia" <[EMAIL PROTECTED]> > 08/27/2004 04:12 PM > > > To: [EMAIL PR

Re: system call

2004-08-27 Thread DBSMITH
es say the return code is two 8 bit values in one 16 bit number. thank you , Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams "Wiggins d Anconia" <[EMAIL PROTECTED]> 08/27/2004 04:12 PM To: [EMAIL PROTECTED], [EMAIL PROTECTED] cc: Subject:

Re: system call

2004-08-27 Thread Wiggins d Anconia
> > All, > > I want to capture the exit value of a system call. How can I do this? > My code is: > > system ( " cat /tmp/foo" ); > if ( $? == 0 ) { > > blah blah blah > } > > > I read the cookbook and it says : > > Both wait and waitpid return the process

Re: 'system' and parallel execution (was: Re: How to call a perl script....)

2004-06-25 Thread Wiggins d Anconia
> > Wiggins d Anconia wrote: > > >It's dangerous to make blanket statements like this. Each is a tool that > >should be understood and applied in the right manner. > > > I agree with this. Generally system would be the right fit for many of > my Perl programs. However exec has it's place like

Re: 'system' and parallel execution (was: Re: How to call a perl script....)

2004-06-25 Thread u235sentinel
Wiggins d Anconia wrote: It's dangerous to make blanket statements like this. Each is a tool that should be understood and applied in the right manner. I agree with this. Generally system would be the right fit for many of my Perl programs. However exec has it's place like any tool. That is w

  1   2   3   >