Reputation: 19
`hn = 'hostname'
echo "Hostname: $hn"`
This is what I did for the kernel version as well, but this is giving me a two line output with the hostname on top and then "Hostname:" below. So how do I get the output to be "Hostname: " ?
Upvotes: 0
Views: 1056
Reputation: 73
$(hn=`hostname`; echo "Hostname: $hn")
or a more human readable format:
$(hn=$(hostname); echo "Hostname: $hn")
Upvotes: 1