From owner-freebsd-questions@freebsd.org Mon Aug 10 06:41:42 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 694273C6B5F for ; Mon, 10 Aug 2020 06:41:42 +0000 (UTC) (envelope-from 4250.82.1d4c20007da5470.44c2b1a0331d6881c3224653e4b10cbb@email-od.com) Received: from s1-b0c6.socketlabs.email-od.com (s1-b0c6.socketlabs.email-od.com [142.0.176.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BQ5wP1Kbjz3Z30 for ; Mon, 10 Aug 2020 06:41:40 +0000 (UTC) (envelope-from 4250.82.1d4c20007da5470.44c2b1a0331d6881c3224653e4b10cbb@email-od.com) DKIM-Signature: v=1; a=rsa-sha256; d=email-od.com;i=@email-od.com;s=dkim; c=relaxed/relaxed; q=dns/txt; t=1597041701; x=1599633701; h=content-transfer-encoding:content-type:mime-version:references:in-reply-to:message-id:subject:cc:to:from:date:x-thread-info; bh=Zsf5JcQj1oqztQ6ImpHCYQv3BRvRSIN0UbjxdqX56M0=; b=h1qL/BwCh/xVhLi4e3bQvvemBaibl/WTfswElIr71ueadwKdssm5sYz5UiLPzElx5N9jw951DWcPEZv0ZbtmuPiTPAc7PDCBc6aS4uXEBECtj8TJrCg4Cj47YAt7F6DOt4pC/BqFafZ+R262qDROKl2czPPfZ+Nx+OExsUbRZV4= X-Thread-Info: NDI1MC45Mi4xZDRjMjAwMDdkYTU0NzAuZnJlZWJzZC1xdWVzdGlvbnM9ZnJlZWJzZC5vcmc= Received: from r1.sg.in.socketlabs.com (r1.sg.in.socketlabs.com [142.0.179.11]) by mxsg2.email-od.com with ESMTP(version=Tls12 cipher=Aes256 bits=256); Mon, 10 Aug 2020 02:41:38 -0400 Received: from smtp.lan.sohara.org (EMTPY [185.202.17.215]) by r1.sg.in.socketlabs.com with ESMTP(version=Tls12 cipher=Aes256 bits=256); Mon, 10 Aug 2020 02:41:37 -0400 Received: from [192.168.63.1] (helo=steve.lan.sohara.org) by smtp.lan.sohara.org with smtp (Exim 4.94 (FreeBSD)) (envelope-from ) id 1k51V2-000CKF-2E; Mon, 10 Aug 2020 07:41:36 +0100 Date: Mon, 10 Aug 2020 07:41:35 +0100 From: Steve O'Hara-Smith To: Aryeh Friedman Cc: Robert Huff , Ernie Luzar , "freebsd-questions@freebsd.org" Subject: Re: csh use of grep | tr commands Message-Id: <20200810074135.c76402a37676b5d2bf03b851@sohara.org> In-Reply-To: References: <5F30962B.5060005@gmail.com> <24368.41568.96908.196223@jerusalem.litteratus.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) X-Clacks-Overhead: "GNU Terry Pratchett" Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BQ5wP1Kbjz3Z30 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=email-od.com header.s=dkim header.b=h1qL/BwC; dmarc=none; spf=pass (mx1.freebsd.org: domain of 4250.82.1d4c20007da5470.44c2b1a0331d6881c3224653e4b10cbb@email-od.com designates 142.0.176.198 as permitted sender) smtp.mailfrom=4250.82.1d4c20007da5470.44c2b1a0331d6881c3224653e4b10cbb@email-od.com X-Spamd-Result: default: False [-1.10 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:142.0.176.0/20]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[email-od.com:+]; NEURAL_HAM_SHORT(-0.85)[-0.846]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[steve@sohara.org,4250.82.1d4c20007da5470.44c2b1a0331d6881c3224653e4b10cbb@email-od.com]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:7381, ipnet:142.0.176.0/22, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[steve@sohara.org,4250.82.1d4c20007da5470.44c2b1a0331d6881c3224653e4b10cbb@email-od.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.04)[-1.037]; R_DKIM_ALLOW(-0.20)[email-od.com:s=dkim]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.02)[-1.017]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[sohara.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[142.0.176.198:from]; RWL_MAILSPIKE_VERYGOOD(0.00)[142.0.176.198:from]; FREEMAIL_CC(0.00)[rcn.com,gmail.com,freebsd.org]; SUSPICIOUS_RECIPS(1.50)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2020 06:41:42 -0000 On Sun, 9 Aug 2020 21:35:12 -0400 Aryeh Friedman wrote: > On Sun, Aug 9, 2020 at 9:27 PM Robert Huff 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. I'll just pack the perl interpreter up again then Seriously though I'd go with cut. $ echo 'ip4="10.111.098.2"' | cut -d\" -f2 10.111.098.2 -- Steve O'Hara-Smith