Dear All,
How do I print only ip address from "fixed-address 10.0.1.25;" field.
Regards,
Saki
grep ip address from dhcpd.conf
-
- Lance Naik
- Posts: 41
- Joined: Sat Jan 13, 2007 1:36 pm
- Location: Bangladesh
- Contact:
grep ip address from dhcpd.conf
Best Regards,
SAKI
8801712764543
SAKI
8801712764543
you can use grep and sed:just sed:or perl:
Code: Select all
grep fixed-address /etc/dhcpd.conf |sed -e 's/^.* //' -e 's/;//'
Code: Select all
sed -n 's/fixed-address \(.*\);/\1/p' /etc/dhcpd.conf
Code: Select all
perl -nle 'print $1 if /fixed-address\s+(.*);/' /etc/dhcpd.conf
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?