[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-ed] Fw: Re: Help with ed command
From: |
John Cowan |
Subject: |
Re: [Bug-ed] Fw: Re: Help with ed command |
Date: |
Wed, 20 May 2015 07:51:54 -0400 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Sonal Kumari scripsit:
> Is there any way in which we write the command using such a delimiter
> which works irrespective of the special symbols present in the
> replacement string.
In the nature of things, there can't be. If either the pattern or the
replacement string contains a given character, then it can't be used
to delimit it. If you are inserting the replacement string from a
shell variable, and it might contain any characters whatsoever,
then you must preprocess the contents of the variable to insert a
backslash before whatever character you choose as a delimiter.
In any case, you will get a surprise if the replacement string
contains a & if you don't change it to \& first.
--
John Cowan http://www.ccil.org/~cowan address@hidden
Lope de Vega: "It wonders me I can speak at all. Some caitiff rogue
did rudely yerk me on the knob, wherefrom my wits yet wander."
An Englishman: "Ay, belike a filchman to the nab'll leave you
crank for a spell." --Harry Turtledove, Ruled Britannia