Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: calling perl script from shell script

by redlemon (Hermit)
on Mar 26, 2004 at 14:31 UTC ( #340023=note: print w/ replies, xml ) Need Help??


in reply to calling perl script from shell script

apart from forgetting a fi, your using the wrong braces: (something) calls "something" in a subshell, which always returns true. The syntax you're looking for is:
if test $? -eq 0 then else fi
or alternatively
if [ $? -eq 0 ] then else fi
Use square braces in stead of round ones. finally, it might be easier to use:
cd go_to_dir_where_perl_program_exists && if /usr/bin/perl perlscript.pl then echo "success" # do some more stuff else echo "failure" # do some more stuff fi
Comment on Re: calling perl script from shell script
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://340023]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2016-04-29 02:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    :nehw tseb si esrever ni gnitirW







    Results (438 votes). Check out past polls.