csh use of grep | tr commands

Steve O'Hara-Smith steve at sohara.org
Mon Aug 10 07:09:40 UTC 2020


On Mon, 10 Aug 2020 02:57:07 -0400
Aryeh Friedman <aryeh.friedman at gmail.com> wrote:

> On Mon, Aug 10, 2020 at 2:41 AM Steve O'Hara-Smith <steve at 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/


More information about the freebsd-questions mailing list