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