Linuxathome.net
https://www.linuxathome.net/forum/

PID extraction
https://www.linuxathome.net/forum/viewtopic.php?f=1&t=64
Page 1 of 1

Author:  DagdaMor [ Fri Aug 02, 2002 8:09 pm ]
Post subject:  PID extraction

Anyone got any good methods for extracting the ID of a process that doesnt make a PID file for itself?? Preferably shell script.

Thanks

Author:  mayhem [ Sat Aug 03, 2002 3:41 am ]
Post subject: 

what do you want to do, somethig like this:
% pid ftp
FTP Process ID is ####


That could be simply done with a shell script

Code:
#!/bin/csh
set data = `ps aux | grep $argv | cut -c 9-15`;
echo "Process ID(s) for $argv are: $data";


e.g. ./pid httpd

Author:  DagdaMor [ Sat Aug 03, 2002 4:19 pm ]
Post subject: 

thanks mayhem it was the cut command i was missing

:D

Page 1 of 1 All times are UTC + 10 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/