Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Need Function for Timing out shell commands

by cdarke (Prior)
on Sep 15, 2011 at 07:40 UTC ( #926088=note: print w/ replies, xml ) Need Help??


in reply to Need Function for Timing out shell commands

I need the return value from the shell programm

You cannot use return from a main program, exit should be used instead (did you use warnings and strict?). Problem with exit though is that you can only return a number (between 0..255), not text. If you must return text:

Replace return $status with print $status
In the shell (Bash or Korn):

/home/fred$ result=$(perl gash.pl) /home/fred$ echo $result Timeout


Comment on Re: Need Function for Timing out shell commands
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (16)
As of 2014-10-23 14:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls