From: Robert K (unixrobert@yahoo.ca)
Date: Thu Nov 09 2006 - 13:48:44 EST
Hello Managers
I have a situation where to find out two classes of servers whose hostnames end with 'ts' and 'ss'. Let us say 'abcdts1',loikts2', 'poidts3','dfgfss1','reoess2', 'eoeoss3' etc. Now I have to grep the two seperate list of servers.I am using the following commands.Most of the servers will have a digit at the end.
bash-2.05# cat /etc/hosts | awk '{print $2}' |grep ts | uniq
bash-2.05# cat /etc/hosts | awk '{print $2}' |grep ss | uniq
Is there any better way? After that I have to make an entry in /etc/hosts as shown in all of the servers.
# vi /etc/hosts
<IP address> <hostname>
There are nearly 75+40 servers that end with 'ts' and 'ss'.Of course there is a digit like 1 or 2 or 3 at the end of (almost) every hostname.
I will summarize and thanks in advance.
Rob
---------------------------------
Make free worldwide PC-to-PC calls. Try the new Yahoo! Canada Messenger with Voice
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:41:09 EDT