sed command via SSH not working as expected
- From: "James Robertson" <JamesR@xxxxxxxxxxxxxx>
- Date: Fri, 21 Aug 2009 15:50:45 +1000
Hi,
I am using openssh from Debian Lenny which is version 1:5.1p1-5.
I am using ssh to run a command on a remote host running Debian Lenny as
well.
The line I am editing with sed looks like this:
'(proxyAddresses=*)' 2>$ERRORLOG | $GREP -if $RELAYDOMAINS | $GREP -Fi
smtp \
I am running the following command to update the line as follows:
ssh root@xxxxxxxxxxxxxxxxxx "sed -i 's/$GREP -Fi smtp/$GREP -Fi smtp |
$SORT -u/' /usr/local/bin/script.sh"
But what I find is that the line ends up looking like this on the remote
host:
'(proxyAddresses=*)' 2>$ERRORLOG | $GREP -if $RELAYDOMAINS | $GREP -Fi
smtp | -u \
The important part being "| -u" which should look like "| $SORT -u".
This command works fine when running it on the command line directly.
Could I be missing something or perhaps this is a bug?
Thanks,
James
- Follow-Ups:
- Re: sed command via SSH not working as expected
- From: Louis-Dominique Dubeau
- Re: sed command via SSH not working as expected
- Prev by Date: Re: ssh and banners
- Next by Date: Re: sed command via SSH not working as expected
- Previous by thread: ssh and banners
- Next by thread: Re: sed command via SSH not working as expected
- Index(es):
Relevant Pages
|