csh weirdness (HELP!)

Alan S. Mazer alan at cogswell.Jpl.Nasa.Gov
Tue Aug 14 01:14:15 AEST 1990


Someone came to me with the following problem and I'm clueless.
If I type (SunOS 4.0.3)

	kill `ps | grep a.out | awk '{printf("%d ",$1);}'`

to kill every instance of a.out I get

	`ps | grep a.out | awk '{printf("%d ",$1);}'`: Ambiguous.

Any idea why?  It's not the $1 (changing that doesn't affect anything), and
it works if the command is in a shell script, or if instead of kill one uses
/bin/kill.  It also works great inside the Bourne shell.  Using echo instead
of kill produces the expected string of space-separated pid's.

I realize that I'm trying to kill the pid of the grep process also.  This is
careless, but apparently not part of the problem since the subshell should
have finished executing by the time the kill starts up.  When it does work
correctly, it always reports the grep process as already dead.

So.  Does anyone have any ideas?

-- Alan			       # My aptitude test in high school suggested that
   ..!ames!elroy!alan	       # I should become a forest ranger.  Sometimes I
   alan at elroy.jpl.nasa.gov     # wonder if that was not indeed my true calling.



More information about the Comp.unix.wizards mailing list