From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1IqwK3-00081y-V5 for garchives@archives.gentoo.org; Sat, 10 Nov 2007 19:48:52 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.2/8.14.0) with SMTP id lAAJlwSq031849; Sat, 10 Nov 2007 19:47:58 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by robin.gentoo.org (8.14.2/8.14.0) with ESMTP id lAAJjpRh029217 for ; Sat, 10 Nov 2007 19:45:52 GMT Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 0A589651AF for ; Sat, 10 Nov 2007 19:45:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at gentoo.org X-Spam-Score: -1.824 X-Spam-Level: X-Spam-Status: No, score=-1.824 required=5.5 tests=[AWL=0.775, BAYES_00=-2.599] Received: from smtp.gentoo.org ([127.0.0.1]) by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nyYkxekLKqTq for ; Sat, 10 Nov 2007 19:45:44 +0000 (UTC) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 4BEF1658EA for ; Sat, 10 Nov 2007 19:45:43 +0000 (UTC) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IqwGj-0004nz-UW for gentoo-dev@gentoo.org; Sat, 10 Nov 2007 19:45:26 +0000 Received: from static24-72-113-196.yorkton.accesscomm.ca ([24.72.113.196]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Nov 2007 19:45:25 +0000 Received: from dirtyepic by static24-72-113-196.yorkton.accesscomm.ca with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Nov 2007 19:45:25 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-dev@lists.gentoo.org From: Ryan Hill Subject: [gentoo-dev] Re: to patch or sed was -> repoman and checking for correct quoting Date: Sat, 10 Nov 2007 13:45:02 -0600 Message-ID: References: <47358D39.8050901@gentoo.org> <20071110173623.GA32402@shuttle> <1194717029.13773.26.camel@wlt.obsidian-studios.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig38CFA3E29D9DA47D0680570E" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: static24-72-113-196.yorkton.accesscomm.ca User-Agent: Thunderbird 2.0.0.6 (X11/20071027) In-Reply-To: <1194717029.13773.26.camel@wlt.obsidian-studios.com> X-Enigmail-Version: 0.95.5 OpenPGP: id=F9A40662; url=subkeys.pgp.net Sender: news X-Archives-Salt: 554c9dd8-7131-4c2c-9393-66de72c51104 X-Archives-Hash: 6dfe86bd679b3d3472265f22194ea163 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig38CFA3E29D9DA47D0680570E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable William L. Thomson Jr. wrote: > Now I know some will scream, puke, throw up in their mouth, and so on. > But seems like sed should have an OPTIONAL argument or etc to tell sed > to either fail if it can't make the change anywhere. And/or keep/output= > a count of how many things were modified. you could use the w flag to the s command. `w FILE-NAME' If the substitution was made, then write out the result to the named file. As a GNU `sed' extension, two special values of FILE-NAME are supported: `/dev/stderr', which writes the result to the standard error, and `/dev/stdout', which writes to the standard= output.(1) dirtyepic@tycho ~/tmp $ cat test this is a test: 12345 line 2 line 3 line 4: 12345 dirtyepic@tycho ~/tmp $ sed -i -e 's:12345:54321:w sed.log' test dirtyepic@tycho ~/tmp $ cat test this is a test: 54321 line 2 line 3 line 4: 54321 dirtyepic@tycho ~/tmp $ cat sed.log this is a test: 54321 line 4: 54321 dirtyepic@tycho ~/tmp $ sed -i -e 's:12345:54321:w sed.log' test dirtyepic@tycho ~/tmp $ cat sed.log dirtyepic@tycho ~/tmp $ or dirtyepic@tycho ~/tmp $ sed -i -e 's:12345:54321:w /dev/stdout' test | wc= -l 2 --=20 looks like christmas at fifty-five degrees this latitude weakens my knees EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662 (0xF9A40662) --------------enig38CFA3E29D9DA47D0680570E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) iD8DBQFHNgo+iqiDRvmkBmIRCGNYAJ9CLg5y+q1ofVfsIiYw31oJEAQxeACg2Lx7 R6HYhaDnbTwLkvAYTugrguQ= =81o1 -----END PGP SIGNATURE----- --------------enig38CFA3E29D9DA47D0680570E-- -- gentoo-dev@gentoo.org mailing list