Re: [OT] run command via ssh - problem

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

 



Dan Track wrote:
> Thanks for that, any thoughts on how it fits in with my script:
>
> for i in server1 server2;do ssh root@$i
> "DNSNAME=\"basename\`hostname\`\";echo $DNSNAME";done

What are you trying to achieve with DNSNAME=\"basename\`hostname\`\";
anyway?  If you want the domainname, dnsdomainname or hostname -d seem
better.  The basename command is for finding the base name of a file.

If the domainname is what you want, something like this would work:

for i in server{1..2}; do
    ssh root@$i 'DNSNAME=$(hostname -d); echo $DNSNAME'
done

I presume you have other steps in between DNSNAME=... and the echo,
otherwise you would just use ssh root@$i hostname -d.

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I look up to the heaven's for a ray of hope to shine.
And there it is in neon: Liquor, beer, and wine.

Attachment: pgp5Bkrgcu4Jg.pgp
Description: PGP signature

-- 
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