From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1MJODA-0005pS-CS for garchives@archives.gentoo.org; Wed, 24 Jun 2009 08:52:08 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0C665E03EC; Wed, 24 Jun 2009 08:52:07 +0000 (UTC) Received: from mail-ew0-f211.google.com (mail-ew0-f211.google.com [209.85.219.211]) by pigeon.gentoo.org (Postfix) with ESMTP id BFF29E03EC for ; Wed, 24 Jun 2009 08:52:06 +0000 (UTC) Received: by ewy7 with SMTP id 7so880263ewy.34 for ; Wed, 24 Jun 2009 01:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=w7g9s27P9NTKjHNexfw66uglM1X3eu9PWys/bTVL9MI=; b=PibuyVqrdASSCuDDtXeZEvmpzK59st8KX0GURqBveZf9N+xJKoBmdVwHT1J6A7M7/f vHT3SxJsvgTJaBScgrabn6o+u4T9+9Ppw16DLHGcIBhD7bb56utvNZthTdj+TX52FcU9 g1EBpU9soAz/iIQHfEd5WJKCcR9yxusU3tki0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=J4GR5MdrNWqhK5f7g4WqCoD3pFwGrnfYOsFFVSEK+RqlZ+WRv/WoPE/A7sB9lAhbB1 Db3dH9gVVB7FHk2Ppy5eRi8z5avizMHuNFeZAdBlnwGwmIwJZC8ClT/bgfr4s1nU1uL+ 5VIHterxhVPY8i7blvXNqyyAXTRzyIocSvKHY= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.210.115.15 with SMTP id n15mr1189825ebc.39.1245833526015; Wed, 24 Jun 2009 01:52:06 -0700 (PDT) In-Reply-To: <20090624023608.0bec60ca@zaphod.digimed.co.uk> References: <200906240048.07549.peter@humphrey.ukfsn.org> <20090624023608.0bec60ca@zaphod.digimed.co.uk> Date: Wed, 24 Jun 2009 11:52:05 +0300 Message-ID: Subject: Re: [gentoo-user] [OT] Use of sed From: "Arttu V." To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 7289a2df-d792-4999-8ae6-9761ae36cf1a X-Archives-Hash: b4bcaeccac7801ceaefbd4870442f1bc On 6/24/09, Neil Bothwick wrote: > On Wed, 24 Jun 2009 00:48:07 +0100, Peter Humphrey wrote: >> And while I'm at it, how do I change the field >> separator from / to enable me to search on that character? > > By using something else, you don't need to tell sed, it works it out for > itself, just use something that isn't in your search string, : is a good > candidate. If I read his question right, he asked about just the simple matchers: //. Perl solves this problem with the optional m in front (m//), so you can do m:/foo: or m+/foo+, but I don't know of a similar toggle for sed (well, I'm a sed newbie, so there might still be one). I don't even think substituting the string with itself (s+/foo+/foo+) would work as I think s/// will succeed every time, even when it doesn't actually substitute anything, so maybe it cannot be used for an "if-then" in sed either? -- Arttu V.