By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,309 Members | 1,452 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,309 IT Pros & Developers. It's quick & easy.

Shell Scripts

100+
P: 158
What i need to do is write a shell script that finds the pid of crond and kill that.

All i need to know is how to set a variable with the result of "pidof cond" and kill that variable.
Aug 31 '07 #1
Share this Question
Share on Google+
1 Reply


docdiesel
Expert 100+
P: 297
Hi, try something like this:

Expand|Select|Wrap|Line Numbers
  1. CRON_PID=` pidof crond ` 
  2.  
  3. echo PID of crond is ${CRON_PID}
  4.  
  5. kill ${CRON_PID}
  6.  
Regards, Bernd
Aug 31 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.