Path: utzoo!attcan!uunet!mcsun!ukc!pyrltd!root44!gwc From: gwc@root.co.uk (Geoff Clare) Newsgroups: comp.unix.questions Subject: Unnecessarily long pipelines (was Re: How do you handle while(1) fork(); ?) Message-ID: <2358@root44.co.uk> Date: 18 Jul 90 10:59:12 GMT References: Organization: UniSoft Ltd., London, England Lines: 14 In price@chakra.unl.edu (Chad Price) writes: >z=`ps -aug | grep $2 | grep -v grep | grep -v csh | grep -v kill | awk '{ print $2 }'` I usually just chuckle to myself when I see things like this, but I decided this time it's worth a comment. Why is it that people string together lots of "grep" commands in a pipeline, when they could do the same job with a single "sed" or "awk" command? In this case it's even worse, because "awk" is already in there as well! -- Geoff Clare (Dumb American mailers: ...!uunet!root.co.uk!gwc) UniSoft Limited, Hayne Street, London EC1A 9HH, England. Tel: +44-71-315-6600