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

[ale] Syntax problem



ssh machine "kill -9 `/sbin/pidof namd`"

On Wed, 2005-08-24 at 11:29 -0400, Scott Warfield wrote:
> you need the quotes to pass everything as an argument to ssh to be
> executed by the remote server.  in this case, ps ax runs remotely piping
> the output locally to grep resulting in an attempt to kill a pid that
> may not exist at best... at worst, well, you can guess ;)
> 
> answer to this.... escape $.  "\$1"
> 
> ssh machine "ps ax|grep namd|grep -v grep| awk '{print(\$1)}'|xargs
> kill"
> 
> On Wed, 2005-08-24 at 11:00 -0400, Jim Popovitch wrote:
> > On Wed, 2005-08-24 at 10:52 -0400, Dow_Hurst wrote:
> > > 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"
> > 
> > Try this (no double quotes):
> >  ssh machine ps ax|grep namd|grep -v grep| awk '{print($1)}'|xargs kill
> > 
> > 
> > -Jim P.
> > 
> > 
> > 
> > _______________________________________________
> > Ale mailing list
> > Ale at ale.org
> > http://www.ale.org/mailman/listinfo/ale
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
-- 
James P. Kinney III          \Changing the mobile computing world/
CEO & Director of Engineering \          one Linux user         /
Local Net Solutions,LLC        \           at a time.          /
770-493-8244                    \.___________________________./
http://www.localnetsolutions.com

GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics)
<jkinney at localnetsolutions.com>
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part