csh question -- Really kill problem
Gertjan van Oosten
gjoost at westc.UUCP
Fri Sep 22 18:27:15 AEST 1989
gjoost at westc.UUCP (Gertjan van Oosten) writes:
>The problem concerns csh-aliases (aliasi ??? - David Addison in
>'Moonlighting').
>The basic problem is as follows: I want an alias to kill all processes
>called 'roy'.
The alias is no longer the problem. The problem lies now with 'kill'; see
the script below.
Script started on Fri Sep 22 10:09:18 1989
% makealias killroy > kr
kill `ps ax | grep -w roy | grep -v grep | awk '{print $1}'`
^D
% cat kr
alias killroy 'kill `ps ax | grep -w roy | grep -v grep | awk '\''{print $1}'\''`'
% source kr
% alias killroy
kill `ps ax | grep -w roy | grep -v grep | awk '{print $1}'`
% roy &
[1] 9456
% killroy
%
[1] Terminated roy
% roy &
[1] 9461
% roy &
[2] 9462
% killroy
`ps ax | grep -w roy | grep -v grep | awk '{print $1}'`: Ambiguous.
% kill `echo 9461 9462`
`echo 9461 9462`: Ambiguous.
% exit
script done on Fri Sep 22 10:12:59 1989
Unless someone has got a solution, I guess I will be needing xargs... :-)
Regards,
+----------------------------------------------------------------------+
| Gertjan van Oosten mcvax!westc!gjoost |
| West Consulting bv |
| Phoenixstraat 49 P.O. Box 3318 Tel: +31-15-123190 |
| 2611 AL Delft 2601 DH Delft Fax: +31-15-147889 |
| The Netherlands |
+----------------------------------------------------------------------+
"But due to a terrible miscalculation in size, the entire fleet got
swallowed by a small dog" - The Hitchhiker's guide to the Galaxy
More information about the Comp.unix.questions
mailing list