csh question -- aliasing, quoting and the like
DAVID NEWALL
CCDN at levels.sait.edu.au
Thu Sep 21 23:09:04 AEST 1989
In article <498 at westc.UUCP>, gjoost at 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 at levels.sait.oz.au
SA Institute of Technology Post: The Levels, South Australia, 5095
More information about the Comp.unix.questions
mailing list