[olug] kill process question

Sean Kelly smkelly at zombie.org
Fri Aug 26 15:35:52 UTC 2005

On Fri, Aug 26, 2005 at 09:31:01AM -0500, 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...

Why not just run it with `exec`?

  g4:~ smkelly$ exec ls

That will run `ls` and then quit the shell. Well, technically `ls` is
replacing the shell and thus when `ls` exits there is nothing left
controlling the terminal.

Sean Kelly         | PGP KeyID: D2E5E296
smkelly at zombie.org | http://www.zombie.org

More information about the OLUG mailing list