Path: utzoo!attcan!utgpu!watmath!att!dptg!rutgers!tut.cis.ohio-state.edu!brutus.cs.uiuc.edu!lll-winken!ames!uhccux!munnari.oz.au!mimir!hugin!augean!sirius!nt!levels!ccdn From: CCDN@levels.sait.edu.au (DAVID NEWALL) Newsgroups: comp.unix.questions Subject: Re: csh question -- aliasing, quoting and the like Message-ID: <1758@levels.sait.edu.au> Date: 21 Sep 89 13:09:04 GMT References: <498@westc.UUCP> Organization: Sth Australian Inst of Technology Lines: 17 In article <498@westc.UUCP>, gjoost@westc.UUCP (Gertjan van Oosten) writes: > The basic problem is as follows: I want an alias to kill all processes > called 'roy'. > > % alias killroy 'kill `ps ax | grep -w roy | grep -v grep | awk '{print $1}'`' > > The problem comes down to having single quotes within single quotes. What's wrong with cut? Use cut before you go diving for awk. % alias killroy 'kill `ps ax | grep -w roy | grep -v grep | cut -c1-5`' David Newall Phone: +61 8 343 3160 Unix Systems Programmer Fax: +61 8 349 6939 Academic Computing Service E-mail: ccdn@levels.sait.oz.au SA Institute of Technology Post: The Levels, South Australia, 5095