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 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 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 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 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 call

2003-08-29 Thread John W. Krahn
Imtiaz Ahmad wrote: > > Hi- Hello, > Can someone please tell me how do I modify following line so that the result > gets stored in the var. > > $count = system("$command $archive_dir | $grep_command -c $string1") ; open PIPE, "$command $archive_dir |" or die "Cannot open pipe from $command: $

RE: system call

2003-08-29 Thread NYIMI Jose (BMB)
perldoc -q backticks José. -Original Message- From: Imtiaz Ahmad [mailto:[EMAIL PROTECTED] Sent: Thursday, August 28, 2003 10:48 PM To: [EMAIL PROTECTED] Subject: system call Hi- Can someone please tell me how do I modify following line so that the result gets stored in the var. $c

RE: system call

2003-08-29 Thread Hanson, Rob
Use backticks. $result = `some command`; system() on the other hand returns the exit status code. $exit_code = system('some command'); ...Or... if (system('some command') != 0) { print "Failed!"; } Rob -Original Message- From: Imtiaz Ahmad [mailto:[EMAIL PROTECTED] Sent: Thursday

RE: system() call fails

2003-02-05 Thread yargo
I'd try : @MakeCmd = ("nmake", "-f", "Nmakefile.mak"); $rc = system(join " ",@MakeCmd); -Original Message- From: meriwether lewis [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 7:17 AM To: [EMAIL PROTECTED] Subject: system() call fails Hi Gurus! I'm running Perl 5.004_04

Re: system() call fails

2003-02-04 Thread km
try with : system("@MakeCmd"); KM On Wed, 5 Feb 2003, Jeff 'japhy' Pinyan wrote: > On Feb 4, meriwether lewis said: > > >The system() command in the following script is > >failing with a: "No such file or directory" > >error. > > What makes yo

Re: system() call fails

2003-02-04 Thread Jeff 'japhy' Pinyan
On Feb 4, meriwether lewis said: >The system() command in the following script is >failing with a: "No such file or directory" >error. What makes you think the system() call is failing? $! only holds a usable value if something goes wrong. Is $rc equal to 0 or not? Only if $rc is non-zero will

Re: system call

2003-01-30 Thread km
Hi, pls try perldoc Shell at the command prompt KM On 30 Jan 2003, simran wrote: > not sure what you mean... but try: > > perldoc perlsec > > as a starting point... > > > On Thu, 2003-01-30 at 12:38, jdavis wrote: > > hel

Re: system call

2003-01-29 Thread John W. Krahn
Jdavis wrote: > > hello, Hello, > Could someont tell me the secure way > to get input from a system call > like... > > $date = `/bin/date`; > > or > > $client = `/usr/bin/finsmb`; The output from using backticks is just data and so is not inherently insecure. However, how do you know that

Re: system call

2003-01-29 Thread simran
not sure what you mean... but try: perldoc perlsec as a starting point... On Thu, 2003-01-30 at 12:38, jdavis wrote: > hello, > Could someont tell me the secure way > to get input from a system call > like... > > $date = `/bin/date`; > > or > > $client = `/usr/bin/finsmb`; > > TIA, > -

Re: system call troubles...

2002-09-30 Thread david
Jenda Krynicky wrote: > Windows is one example. > > There you do not create a new process by forking and then changin the > program your process executes, but by a CreateProcess(): > > (from MSDN) > The CreateProcess function creates a new process and its primary > thread. The new process runs

Re: system call troubles...

2002-09-29 Thread Jenda Krynicky
From: david <[EMAIL PROTECTED]> > Jenda Krynicky wrote: > > > From: david <[EMAIL PROTECTED]> > >> Chris wrote: > >> > >> > # ** ** > >> > # print "Trying to Run -- system $playerApp ($webCast):\n"; > >> > # system $playerApp, ($webCast); > >> > # ** ** > >> > > >> > # ** ** > >> >print "

Re: system call troubles...

2002-09-27 Thread david
Jenda Krynicky wrote: > From: david <[EMAIL PROTECTED]> >> Chris wrote: >> >> > # ** ** >> > # print "Trying to Run -- system $playerApp ($webCast):\n"; >> > # system $playerApp, ($webCast); >> > # ** ** >> > >> > # ** ** >> >print "Trying to Run -- exec $playerApp $webCast:\n"; >> >e

Re: system call troubles...

2002-09-27 Thread Jenda Krynicky
From: david <[EMAIL PROTECTED]> > Chris wrote: > > > # ** ** > > # print "Trying to Run -- system $playerApp ($webCast):\n"; > > # system $playerApp, ($webCast); > > # ** ** > > > > # ** ** > >print "Trying to Run -- exec $playerApp $webCast:\n"; > >exec $playerApp, ($webCast); > > # *

Re: system call troubles...

2002-09-27 Thread david
Chris wrote: > # ** ** > # print "Trying to Run -- system $playerApp ($webCast):\n"; > # system $playerApp, ($webCast); > # ** ** > > # ** ** >print "Trying to Run -- exec $playerApp $webCast:\n"; >exec $playerApp, ($webCast); > # ** ** > system() is basically just a fork(), exec(), w

Re: system call troubles...

2002-09-26 Thread Sudarshan Raghavan
On Thu, 26 Sep 2002, Chris (?) wrote: > Hello world! > > I've found myself troubled with a very simple problem. Or.. at least what > should be a simple problem. > > If anyone can help me out, i'd greatly appreciate it. I've included my > code, in full; though it's not very long. > >

Re: System call from CGI script

2001-10-24 Thread James B. Williams II
Hi all, Sorry if this reposts, but this didn't seem to go through the first time.. I just posted a question to the beginners-cgi list yesterday; I'm having almost the exact same problem. Both my cgi script and the script I am trying to call via system are owned by root, but I'm not sure if tha

Re: System call to print to webpage

2001-09-23 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (David Freeman) wrote: > $uptime = system ("/usr/bin/uptime"); you want to save the output, so use backticks. my $uptime = `/usr/bin/uptime`; -- brian d foy <[EMAIL PROTECTED]> - Perl services for hire CGI Meta FAQ - http://www.perl.org/CG

Re: System call problem

2001-05-16 Thread Peter Scott
At 11:32 AM 5/16/01 -0600, Scott Burks wrote: >I have a script that has the following two lines: > >system("echo find /OPERATIONS/system_cleanup/logs -name \"'log.*'\" >-mtime +30 -exec rm {} '\\;' '>> $log_file 2>&1'"); > >system("find /OPERATIONS/system_cleanup/logs -name \"'log.*'\" -mtime >+30

RE: system call question

2001-05-02 Thread J. Patrick Lanigan
Thanks for the advice. I would've thought about that sooner or later, but better sooner than later. And this is not on a high traffic site, in fact only a few select folks know about it. Anyhow, hows this... my $manpage = param("manpage"); if ($manpage =~ /^([-\@\w.]+)$/) {

Re: system call question

2001-05-02 Thread Kevin Meltzer
On Wed, May 02, 2001 at 04:20:49PM -0500, J. Patrick Lanigan ([EMAIL PROTECTED]) spew-ed forth: [snip] > my $manpage = param("manpage"); > my @output = `man $manpage | perl -pe 's/(?:.\cH)//g'`; #Thanks Paul Please read perlsec and untaint $manpage (by hand, or with

RE: system call question

2001-05-02 Thread J. Patrick Lanigan
Man, this list rocks, and I am really atarting to love this language. Thanks for all your suggestions. Ultimately, Paul is the winner :) The code follows works wonders: #!/usr/bin/perl -w use strict; use CGI qw(:standard); print header(), start_html("Online Manpag

Re: system call question

2001-05-02 Thread Paul
--- Casey West <[EMAIL PROTECTED]> wrote: > On Wed, May 02, 2001 at 03:12:23PM -0500, J. Patrick Lanigan wrote: > : Thanks to Paul and Mike for the quick response. > : > : Now, does anyone know how I can trim out the unwanted charecters > from the > : output of a man page so that I can display i

Re: system call question

2001-05-02 Thread Casey West
On Wed, May 02, 2001 at 03:12:23PM -0500, J. Patrick Lanigan wrote: : Thanks to Paul and Mike for the quick response. : : Now, does anyone know how I can trim out the unwanted charecters from the : output of a man page so that I can display it in a browser? Well, you could use the man2html utili

clean up man output (was Re: system call question)

2001-05-02 Thread Me
This group is great, but sometimes deja's still the best source! ;> http://groups.google.com/groups?q=%22man+output%22+perl > Now, does anyone know how I can trim out the unwanted charecters from the > output of a man page so that I can display it in a browser? > > Sample as is: > > NNAAMMEE

RE: system call question

2001-05-02 Thread J. Patrick Lanigan
Thanks to Paul and Mike for the quick response. Now, does anyone know how I can trim out the unwanted charecters from the output of a man page so that I can display it in a browser? Sample as is: NNAAMMEE ls - list directory contents SSYYNNOOPPSSIISS llss [_O_P_T

Re: system call question

2001-05-02 Thread Mike Lacey
yep -- and backticks sets $? with the return code as well, so you get both if you want. - Original Message - From: "Paul" <[EMAIL PROTECTED]> To: "J. Patrick Lanigan" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, May 02, 2001 8:4

Re: system call question

2001-05-02 Thread Paul
--- "J. Patrick Lanigan" <[EMAIL PROTECTED]> wrote: > Now that I have CGI working with apache on my server, I am > experimenting. > Anyhow, I wrote the following script and was wondering how to capture > the output of a system call. I am trying to capture the output so that > I can format it for

Re: system call question

2001-05-02 Thread Mike Lacey
Patrick, Put your command in backticks and set a variable to its output (like this $var = `man $manpage`;) - Original Message - From: "J. Patrick Lanigan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 02, 2001 8:25 PM Subject: system call question > Now that I have C