[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] substitution causing issues in ssh to remote host backti
Re: [Help-bash] substitution causing issues in ssh to remote host backtick
Fri, 08 Aug 2014 13:23:55 -0400
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
On 8/8/14, 11:26 AM, Rajeev Prasad wrote:
> hello friends,
> can someone help understand why 1st is working but second is not?
> ssh server10 'for t in `ls /xyz/abc/lmn|grep -v xxx`;do ls /xyz/abc/lmn/$t |
> sed -e "s/some/someelse/";done'
> not working:
> ssh $host 'for t in `ls $folder|grep -v xxx`;do ls $folder/$t | sed -e
> it seems substitution inside backtick is causing the failure, but i am not
> able to understand why?
The single quotes inhibit variable expansion in the context where you want
it to take place.
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/