Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!rutgers!usc!csun!csuna!abcscnge From: abcscnge@csuna.csun.edu (Scott "The Pseudo-Hacker" Neugroschl) Newsgroups: comp.unix.questions Subject: Re: Killing with awk vs. cut Message-ID: <2153@csuna.csun.edu> Date: 23 Aug 89 06:46:01 GMT References: <20608@adm.BRL.MIL> Reply-To: abcscnge@csuna.csun.edu (Scott Neugroschl) Distribution: usa Organization: CSU Northridge Lines: 23 In article <20608@adm.BRL.MIL> ritter@cs.msstate.edu (Thomas H. Ritter) writes: ]In a recent article: ]All the solutions I saw used awk to get the second column of the ]ps listing. Why use such a general purpose tool for so simple ]a task? SystemV provides the cut command. eg. ] ]kill `ps -aux | fgrep -e -sleeper | egrep -v fgrep | cut -d" " -f5` The problem with cut is that if you specify the delimiter with -d, then consecutive delimiters will return empty strings: e.g. ab where is a single blank: cut -d" " -f2 returns an empty string, and cut -d" " -f3 returns the b Scott -- Scott "The Pseudo-Hacker" Neugroschl UUCP: ...!sm.unisys.com!csun!csuna.csun.edu!abcscnge -- Beat me, Whip me, make me code in Ada -- Disclaimers? We don't need no stinking disclaimers!!!