Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^4: perl alarms not working as expected

by kavkazi (Initiate)
on Oct 16, 2012 at 19:18 UTC ( #999403=note: print w/ replies, xml ) Need Help??


in reply to Re^3: perl alarms not working as expected
in thread perl alarms not working as expected

Thank You @betterworld for the line: system("sleep 10 3>$tmpnam"); what does 3>$tmpnam do? If I need to replace the sleep 10 with a call to script that needs arguments, how would I do that? i.e: system("/opt/bea/domains/fsa/scripts/start.sh fsaAs02 -q 3>$tmpnam");


Comment on Re^4: perl alarms not working as expected
Re^5: perl alarms not working as expected
by betterworld (Deacon) on Oct 16, 2012 at 22:08 UTC
    system("/opt/bea/domains/fsa/scripts/start.sh fsaAs02 -q 3>$tmpnam");

    Yes, that seems right.

    Shell redirections:

    "command > file" redirects standard output into a file. Standard output is file descriptor 1.

    "command < file" redirects standard input from a file. Standard input is file descriptor 0.

    Standard error is file descriptor 2, and the first free descriptor is usually 3. Therefore I used "command 3> file" so that the (dummy) file descriptor 3 is connected to a temporary file, which was created using File::Temp.

    In my experience, open files are a very nice means to keep track of a running process. The command "fuser" can be used to find the processes that are connected to a file. "fuser" will kill these processes when "-k" is specified.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (16)
As of 2014-04-23 17:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (549 votes), past polls