Re: ssh and many command line
On Tue, 12 Aug 2003 13:50:30 +0100
Colin Watson <cjwatson@debian.org> wrote:
> On Tue, Aug 12, 2003 at 01:35:53PM +0200, Fran?ois Chenais wrote:
> > hello,
> >
> > I try to execute many command on a remote system through ssh but some of those commands fails. What is THE way to execute many commands through ssh ?
> >
> >
> > exemples
> > -----------
> >
> > [1] ssh root@myhost "cat /etc/passwd | awk -F ':' '{ print $1; }'"
> >
> > ONLY prints empty lines
>
> You're not quoting correctly. $1 is expanded within "" by the shell on
> the *local* machine. Try this:
>
> echo "cat /etc/passwd | awk -F ':' '{ print $1; }'"
>
U mean
"echo \"`cat /etc/passwd | awk -F ':' '{ print $1; }'\""
Reply to: