ssh remote command

Paul Baumgardner pbaumgardner at gmail.com
Wed Oct 25 12:55:01 EDT 2006


On 10/25/06, nmeyers at javalinux.net <nmeyers at javalinux.net> wrote:
> In the ssh case, the $2 is inside double-quotes, so it's being
> interpolated by your shell on server1 - probably as an empty string,
> so the awk command you're sending is {print  }. You could escape the $,
> or switch quote style in the middle, like this:
>
>   ssh server2 "grep 'ORA-' /var/log/core.log | awk '{print "'$2'"}' | sort | uniq -c | sort -rn"
>
> What I'm doing is ending the double-quote, starting a single-quote,
> then ending that and returning to double-quote.


Perfect, Thanks eveyone!

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the Discuss mailing list