DeyfishinDemhills
Technical User
I'm a NetApp admin for a board design firm here in California. I'm trying to automate the host_name location of all Role Accounts that exist in our network.
I use ypcat on our proprietary auto.home file to locate the Role Account individually and awk to print just the second "chunk" of resulting information,
the result always spits out the entire path where this Role Account is homed,
What I really want is a result with JUST THE HOST_NAME, "TCP-hombre02" and nothing else. The path is important but I'm really interested in just the host.
Is awk really only limited to displaying a specific "chunk" as defined by value of x, as in {print $x]? If so, then how can I meet my goal of discovering a Role Account's host w/o the appending path?
Ideally, if I can figure this out I can automate discovery of thousands of RAs in our system and print this information to other maintenance applications in the enterprise.
many thanks,
FF#24
I use ypcat on our proprietary auto.home file to locate the Role Account individually and awk to print just the second "chunk" of resulting information,
Code:
#ypcat -k auto.home | grep -w ireland5 | awk '{print $2}'
the result always spits out the entire path where this Role Account is homed,
Code:
TCP-hombre02:/vol/vol01/Roleaccounts/&
What I really want is a result with JUST THE HOST_NAME, "TCP-hombre02" and nothing else. The path is important but I'm really interested in just the host.
Is awk really only limited to displaying a specific "chunk" as defined by value of x, as in {print $x]? If so, then how can I meet my goal of discovering a Role Account's host w/o the appending path?
Ideally, if I can figure this out I can automate discovery of thousands of RAs in our system and print this information to other maintenance applications in the enterprise.
many thanks,
FF#24