korn shell script on Solaris
getent hosts <hostname> returns
IP FQDN
But I just want the output to be like this
<hostname> IP
things I have tried so far
getent hosts <hostname> |awk '{print $2,$1}'
using awk and substr
getent hosts <hostname> |nawk '{print substr($2,1,5)}'
using cut command
getent hosts <hostname> |cut -f2,1
any ideas?
I am planning on just 2 seperate commands to get my output but I want to see if I can do this using the getent hosts command