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.