csh use of grep | tr commands

Steve O'Hara-Smith steve at sohara.org
Mon Aug 10 06:41:42 UTC 2020


On Sun, 9 Aug 2020 21:35:12 -0400
Aryeh Friedman <aryeh.friedman at gmail.com> wrote:

> On Sun, Aug 9, 2020 at 9:27 PM Robert Huff <roberthuff at rcn.com> wrote:
> 
> > Ernie Luzar writes:
> >
> > >  Double quotes are giving me trouble.
> > >
> > >  I have a file with a line in it like this
> > >  ip4="10.111.098.2"
> > >  I want to get just the ip address
...
> >         Would awk perhaps be a better tool?
> >
> 
> Complete overkill for what he wants to do.
> 
> He wants to bang a nail in thus only needs a hammer he does not need a
> nail gun for only one nail.

<fx: click>I'll just pack the perl interpreter up again then</fx>

	Seriously though I'd go with cut.

$ echo 'ip4="10.111.098.2"' | cut -d\" -f2
10.111.098.2

-- 
Steve O'Hara-Smith <steve at sohara.org>


More information about the freebsd-questions mailing list