![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help in background process | chella | Shell Programming and Scripting | 5 | 12-03-2007 11:57 PM |
| background process | vinod.thayil | Shell Programming and Scripting | 1 | 08-17-2007 02:56 AM |
| background process | k_oops9 | Shell Programming and Scripting | 3 | 11-15-2004 01:15 AM |
| background process | badshah | High Level Programming | 3 | 05-30-2003 08:01 AM |
| capture the process id when starting a background process | jleavitt | Shell Programming and Scripting | 10 | 04-04-2002 05:04 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
PIDs of background process
How to track the pid of a background child process(shell script) from a parent script ?
For example :- $ sleep 10000 & [1] 4220 where 4220 is the pid of bg process sleep. Now my requirement is to keep the sleep statement in a shell script(test.ksh) and will be invoking it from another shell script (test2.ksh). Is there any way to get the pid of test.ksh (child background process) from test2.ksh? Last edited by ramkumar; 02-09-2005 at 03:44 AM. Reason: To make it more clear |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
ram...
when u r creating the script test2.ksh, immeditaely after you call test.ksh you could give ID=$$ ID being just another variable, $$ would give the PID of the last process you have run. Quote:
Last edited by Naanu; 02-09-2005 at 08:58 AM. |
|
#3
|
|||
|
|||
|
$! is the pid of the most recent process, $$ is the pid of the current process, $PPID is the parent pid. In Korn shell.
|
|
#4
|
|||
|
|||
|
whooopsie jim...thx for correcting...
Quote:
|
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|