I'm trying to extract some information from a list of servers and so I wrote this one liner which I will then pass through ssh user@machine 'command'
:
# hostname > info ; cat /etc/*-release | awk 'NR==3' >> info ; uname -a >> info ; rpm -qa >> info ; mail -s '`hostname` install list' itaig@mydomain.com < info
I've also tried:
[root@itai-test ~]# hostname > info ; cat /etc/*-release | awk 'NR==3' >> info ; uname -a >> info ; rpm -qa >> info ;hn=`/bin/hostname` ; mail -s '$hn install list' itaig@amadeus.co.il < info
But the subject looks like this:
$hn install list