Computing.Net > Forums > Linux > kill is not working within awk

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

kill is not working within awk

Reply to Message Icon

Name: jyoti
Date: May 11, 2005 at 04:57:10 Pacific
OS: RHL 9
CPU/Ram: P4/512
Comment:

Hallo...
I need to run this script to protect the user1 from more than 30% cpu usage.But kill is not working within awk.What should I do ??

#!/bin/bash

ps -fuU user1 >> psFile

awk '{ if( $3 > "30")
kill -9 $2 }' psFile
rm psFile

Help me.Thank u.



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: May 11, 2005 at 06:17:09 Pacific
Reply:

Calling an external command requires to use the system command such as this:

system("kill -9 $2")


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: kill is not working within awk

DNS is not working www.computing.net/answers/linux/dns-is-not-working/19291.html

Sound Card is not working www.computing.net/answers/linux/sound-card-is-not-working/29232.html

Ethernet is not working www.computing.net/answers/linux/ethernet-is-not-working/29976.html