[comp.unix.questions] csh question -- Really kill problem

gjoost@westc.UUCP (Gertjan van Oosten) (09/22/89)

gjoost@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

maart@cs.vu.nl (Maarten Litmaath) (09/25/89)

gjoost@westc.UUCP (Gertjan van Oosten) writes:
\...
\% kill `echo 9461 9462`
\`echo 9461 9462`: Ambiguous.

YACB (Yet Another Csh Bug).
Use:
	/bin/kill `...`
or
	eval kill `...`
-- 
   creat(2) shouldn't have been create(2): |Maarten Litmaath @ VU Amsterdam:
      it shouldn't have existed at all.    |maart@cs.vu.nl, mcvax!botter!maart