home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!torn!nott!bnrgate!bcars664!leibniz!walt
- From: walt@bcarh1d7.bnr.ca (Walt Sullivan)
- Newsgroups: comp.unix.programmer
- Subject: Re: *** Simple batch-style Unix question
- Message-ID: <WALT.92Dec21111550@bcarh1d7.bnr.ca>
- Date: 21 Dec 92 16:15:50 GMT
- References: <1992Dec11.222613.10867@murdoch.acc.Virginia.EDU>
- Sender: news@bcars664.bnr.ca
- Followup-To: sender
- Organization: Bell-Northern Research, Ottawa, Canada
- Lines: 23
- In-reply-to: tdh6t@fulton.seas.Virginia.EDU's message of 11 Dec 92 22:26:13 GMT
-
- >>>>> On 11 Dec 92 22:26:13 GMT, tdh6t@fulton.seas.Virginia.EDU (Todd #$%!@! Hodes) said:
-
- Todd> Firstly, I'm under SunOS 4.1.1.
-
- Todd> Now... say I've gotten a process ID from grep'ing a
- Todd> ps command, and want to send it to a 'kill -9'
-
- Todd> How do I do this ?
-
- Todd> ps -aux | grep "xv " | sort -2 | awk '{if (NR == 1) print $2;}' | cat
-
- Todd> outputs the correct pid.
-
- You want to pass the output of the above as an argument to kill. Use backticks (`):
-
- kill -9 `ps -aux | grep "xv " | sort -2 | awk '{if (NR == 1) print $2;}'`
-
-
- --
- Walt Sullivan
- INTERNET: walt@bnr.ca (work)
- UUCP: walt@orbit.ocunix.on.ca (home)
- FIDO: 1:163/109.4
-