This is for an assignment so I have no choice but to use sed.
Given a file messages, how can I extract all the IP addresses and print them?
I first
You can do that too:
Windows:
ipconfig | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1' | sed '2 d' | head -n1;
OSX:
ifconfig | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1' | sed '1 d' | head -n1;