csh use of grep | tr commands

Ernie Luzar luzar722 at gmail.com
Mon Aug 10 00:34:56 UTC 2020

Double quotes are giving me trouble.

I have a file with a line in it like this
I want to get just the ip address

ip=`grep "ip4=" directory-path/file-name

$ip ends up having ip4=""  in it

ip=`echo -n "${ip}" | tr -d "ip4="

$ip ends up having ""  in it

Putting | tr """ " "` after the echo above gives error.

How do I remove the " around the ip address?

More information about the freebsd-questions mailing list