Date: Mon, 10 Aug 2020 07:41:35 +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: <20200810074135.c76402a37676b5d2bf03b851@sohara.org> In-Reply-To: <CAGBxaX=%2B6Lji_zDUKTvrq4Kdo%2BM1jFDjLtDpTuU_Ue1Q_VJ3AQ@mail.gmail.com> References: <5F30962B.5060005@gmail.com> <24368.41568.96908.196223@jerusalem.litteratus.org> <CAGBxaX=%2B6Lji_zDUKTvrq4Kdo%2BM1jFDjLtDpTuU_Ue1Q_VJ3AQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 9 Aug 2020 21:35:12 -0400 Aryeh Friedman <aryeh.friedman@gmail.com> wrote: > On Sun, Aug 9, 2020 at 9:27 PM Robert Huff <roberthuff@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@sohara.org>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200810074135.c76402a37676b5d2bf03b851>