Re: [OT] run command via ssh - problem

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

 



On 11/04/2009 09:23 PM, Bill Davidsen wrote:
for i in server1 server2;do ssh root@$i "DNSNAME=$(basename
$(hostname)$);echo $DNSNAME";done
             A      A
             |      |
what is that?       |

That's the closing paren for the nested shell expansion that begins with basename on the line above:

$(basename $(hostname))
 ^                    ^

The uselessness of basename in this situation has been pointed out but the syntax is just fine.

need a backslash before the $

Not if you use single quotes as was already suggested.

Regards,
Bryn.

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux