I'm trying to echo the release version of some of our Linux servers. Typically I do these types of things by "catting" a text file with the host names, "ssh-ing" to the host and running my string.
This is what I've written
This works, but I get output like
I'm trying to get it to look like
I've looked around the forums and messed with printf and echo -n but I can't seem to get the syntax right. Any help is appreciated.
This is what I've written
Code:
for i in `cat versions.txt` ; do echo $i ; ssh $i cat /etc/issue | grep release ; done
Code:
ServerName
Red Hat Enterprise Linux Server release 5.6 (Tikanga)
Code:
ServerName Red Hat Enterprise Linux Server release 5.6 (Tikanga)