[olug] kill process question
    Daniel Linder 
    dan at linder.org
       
    Fri Aug 26 14:47:01 UTC 2005
    
    
  
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Fri, August 26, 2005 09:31, Craig Wolf wrote:
> I am running a script in a terminal window and want to kill the
window
> when the script finishes.  I know that I am close but the command
looks
> ugly...any suggestions?? (I know nothing about awk...but willing to
> learn.  8)
> 
> ps aux |grep Terminal |killall -9 {awk $2}
> 
> If I am way off base, I am looking for ANY and ALL help.  I am in
> crunch time to have this done by tomorrow...
How about this:
ps aux | grep Terminal | awk '{ print "kill -9 " $2 '} | sh
If you remove the final "| sh", this script will show the full
kill commands it would run.  The |sh executes them for you.
Dan
- - - - -
"Wait for that wisest of all counselors, time." -- Pericles
"I do not fear computer, I fear the lack of them." -- Isaac
Asimov
GPG fingerprint:6FFD DB94 7B96 0FD8 EADF  2EE0 B2B0 CC47 4FDE 9B68
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFDDytlsrDMR0/em2gRArCqAKC3Ivd1kTWhhhY8IkePtKr4+Xk2qQCgnnKb
JMPb4QSjjrOgnFmqA+CVYkU=
=iZ92
-----END PGP SIGNATURE-----
    
    
More information about the OLUG
mailing list