Hello all,
I'm having a problem and would like to know if anyone has a solution. I would like to search my /etc/hosts file for and ip address say 10.1.1.1. I'm currently have this IP address as a variable, but I only what it to match it.
I have grep $IP /etc/hosts.
grep `\< $IP>\` /etc/hosts
grep "IP" /etc/hosts
sed 's/\^$IP\$/p' /etc/hosts
This would give my everything like 10.1.1.1*, but I only want 10.1.1.1.
I have problem with passing a vaiable to the sed command when I want to use reg expression. I