Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Aug 2020 08:09:28 +0100
From:      Steve O'Hara-Smith <steve@sohara.org>
To:        Aryeh Friedman <aryeh.friedman@gmail.com>
Cc:        Robert Huff <roberthuff@rcn.com>, Ernie Luzar <luzar722@gmail.com>, "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: csh use of grep | tr commands
Message-ID:  <20200810080928.74df05790dd6676439ad750c@sohara.org>
In-Reply-To: <CAGBxaX=5v0_HQMj_%2Bubt_dgnbzw5L8DyNdHzR9k433hfkNg8mw@mail.gmail.com>
References:  <5F30962B.5060005@gmail.com> <24368.41568.96908.196223@jerusalem.litteratus.org> <CAGBxaX=%2B6Lji_zDUKTvrq4Kdo%2BM1jFDjLtDpTuU_Ue1Q_VJ3AQ@mail.gmail.com> <20200810074135.c76402a37676b5d2bf03b851@sohara.org> <CAGBxaX=5v0_HQMj_%2Bubt_dgnbzw5L8DyNdHzR9k433hfkNg8mw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 10 Aug 2020 02:57:07 -0400
Aryeh Friedman <aryeh.friedman@gmail.com> wrote:

> On Mon, Aug 10, 2020 at 2:41 AM Steve O'Hara-Smith <steve@sohara.org>
> wrote:
> 
> >         Seriously though I'd go with cut.
> >
> > $ echo 'ip4="10.111.098.2"' | cut -d\" -f2
> > 10.111.098.2
> >
> 
> Only problem doesn't handle the case where you might have multiple quoted
> values on the line where is cut -f2 -d'='|tr -d '"' does

	Agreed - but since we know it's a quoted IP address we can save a
process.

-- 
Steve O'Hara-Smith                          |   Directable Mirror Arrays
C:\>WIN                                     | A better way to focus the sun
The computer obeys and wins.                |    licences available see
You lose and Bill collects.                 |    http://www.sohara.org/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200810080928.74df05790dd6676439ad750c>