Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: How to get the process Id

by Corion (Patriarch)
on Jul 29, 2015 at 07:38 UTC ( [id://1136717]=note: print w/replies, xml ) Need Help??


in reply to How to get the process Id

This is more a shell question than a Perl question. The usual approach is to get a process which echoes its PID and then have that process replace itself with the target program, keeping the same PID.

Shell scripts can do this using the following idiom:

#!/usr/bin/ksh echo $$ exec tcpdump -i any -w filename.pcap

This will print the PID to the console, but you could just as well output it to a file.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 11:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found