1
my target is to match snmpmanager string from /etc/hosts file in Solaris machine
I don’t get any match output from the following command (but snmpmanager already defined in host file) why??
egrep -i '(^|[[:space:]])snmpmanager($|[[:space:]])' /etc/hosts
my host file
10.170.10.5 loghost
10.170.10.61 Master SyslogSer vip Tcc NtpServer1 NtpServer2 snmpManager snmpManagerPA1 snmpManagerPA2
I also tried the following but without success -:(
egrep -i '(^|[\s])snmpmanager($|\s])' /etc/hosts
egrep -i '(^|[\t])snmpmanager($|\t])' /etc/hosts
I find the solution for solaris its - grep -iwc snmpManager (only need to add w flag) – Eytan – 2012-02-08T17:54:41.650
1@eytan if your solution works, its good to have you make it an answer, and accept it, so the question is closed out – Rich Homolka – 2012-02-08T18:03:20.400