I am using below to retrieve ip address for my Linux (Centos) host and print to a file:-
ip route get 8.8.8.8 | awk 'NR==1 {print $NF}'
Can anyone confirm how can I do the same in HP-UX?
uname -a on by box shows this:- HP-UX tsth6038 B.11.23 U ia64 1187320084 unlimited-user license
Try this:
Have in mind you can have several ip addresses
If you want to get rid of local loop: