Linuxathome.net

Linux news and help for home broadband internet users
It is currently Thu Mar 28, 2024 10:54 pm

All times are UTC + 10 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: PID extraction
PostPosted: Fri Aug 02, 2002 8:09 pm 
Offline
Newbie

Joined: Sun Jun 30, 2002 12:58 am
Posts: 36
Anyone got any good methods for extracting the ID of a process that doesnt make a PID file for itself?? Preferably shell script.

Thanks

_________________
DM


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Aug 03, 2002 3:41 am 
Offline
Admin

Joined: Sun Jun 23, 2002 9:20 pm
Posts: 187
Location: Interweb - Sydney
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

_________________
"Backups are for wimps. Real men upload their data to an FTP site and have everyone else mirror it."
Administrator, Editor, Technical
http://www.linuxathome.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Aug 03, 2002 4:19 pm 
Offline
Newbie

Joined: Sun Jun 30, 2002 12:58 am
Posts: 36
thanks mayhem it was the cut command i was missing

:D

_________________
DM


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 10 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group