I've done a lot of digging but haven't found an answer to my problem.Currently, I have the following command:# netstat | grep telnet | grep ESTABLISHED | awk 'NR==1{ print $5}'Which returns something like:192.168.15.73.64759From this, I want to get just the IP without the port. So,192.168.15.73The system I'm doing this on is running an embedded unix variant and does not support -o as an option to grep.  The system suppors sed which is likely the best route but I'm not familiar with that application at all.Can anyone tell me what I could add to get the output I'm looking for?
Extracting IP from IP.port
sed;regular expression
You could use cut or sed:echo 192.168.15.73.64759 | cut -d '.'  -f 1-4 echo 192.168.15.73.64759 | sed -E 's,\.[0-9]+$,,'Or awk:echo 192.168.15.73.64759 | awk -F '.' '{print $1.$2.$3.$4}'