Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: calling perl script from shell script

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://340023]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.