[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] Syntax problem



What is the proper way to get this command to work:

ssh machine "ps ax|grep namd|grep -v grep| awk '{print($1)}'|xargs kill"

I am trying to get the PIDs for the process namd piped into the kill command on the machine.  If I ssh into the machine and run this command at the shell it works just fine.  Via the ssh command it has syntax problems on the awk statement.  Specifically it says this:
awk: cmd. line:1: {print()}
awk: cmd. line:1:        ^ syntax error
awk: cmd. line:1: {print()}
awk: cmd. line:1:         ^ syntax error
usage: kill [ -s signal | -p ] [ -a ] pid ...
       kill -l [ signal ]

So the () is giving the problem?  I've tried protecting it with \( but that doesn't work.
Any thoughts,
Dow


No sig.