I am just starting out using sed and I intend to use it to extract IP addresses from ping output. Here's what I am trying to achieve exactly:
input text:
ytmti (192.188.2.3) jjggy
desired output:
192.188.2.3
command I am trying:
echo "ytmti (192.188.2.3) jjggy" | sed 's:\((\(192.188.2.3\))\):\2:'
current output:
ytmti 192.188.2.3 jjggy
Note: ytmti and jjggy are really stand-ins for text like Pinging unix.stackexchange.com and with 32 bytes of data:.
I think using awk might be a better solution for parsing ping output,
but I would like to get accustomed to sed.