![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ypbind - multiple instances starting | blowtorch | SUN Solaris | 0 | 10-01-2007 03:51 AM |
| detecting multiple instances | ragha81 | Shell Programming and Scripting | 3 | 04-06-2007 07:09 AM |
| Creating instances of a program | tushar_johri | Shell Programming and Scripting | 2 | 05-25-2005 07:36 AM |
| Multiple file instances | gozer13 | UNIX for Dummies Questions & Answers | 1 | 12-29-2004 04:08 PM |
| multiple instances of syslogd - is it possible? | Gary Dunn | UNIX for Advanced & Expert Users | 9 | 07-20-2004 06:10 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#8
|
|||
|
|||
|
try this
kill `ps -ef |awk '/xterm/ && !/'$$'/' | awk '{print $2}'` |
| Forum Sponsor | ||
|
|
|
#9
|
|||
|
|||
|
here's how I do it
ps aux | grep $1 | awk '{system("kill " $2);}'
I put this in a script named KillAll, then call the script with the string I want to filter for. But, be careful, it doesn't care where it finds your search string, it will kill anything with the string anywhere in the results of ps aux. The script could be easily improved. -Jmt |
|
#10
|
|||
|
|||
|
This may work
kill `ps -ef |awk '/xterm/ && !/'$$'/' | awk '{print $2}'` |
|
#11
|
|||
|
|||
|
JMT and Kundunni,
thank you both a lot for your replies. I'll try your solutions as soon as I get to my work. I am sure JMT's solution will work since I understand what his command exactly does. But kundunni, I'd highly appreciate it if you explain your command. BTW, seeing your posts.. I'm thinking is this: kill -9 `ps -fu | grep "xterm" | awk '{print $2}'` would work? awaiting your reply. Regards Indrajit |
|
#12
|
|||
|
|||
|
In ksh:
ps -eaf | grep xterm | grep -v grep | while read a b c ; do kill $b done |
|
#13
|
|||
|
|||
|
Quote:
Code:
ps -fu $USER |
|||
| Google The UNIX and Linux Forums |