On 6/24/09, Neil Bothwick <n...@digimed.co.uk> 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.

Reply via email to