- To: Russell Davies <russell.davies@xxxxxxxxxxxxx>, slug@xxxxxxxxxxx
- Subject: Re: [SLUG] sed help please
- From: Jim Clark <jim@xxxxxxxxxxxxxx>
- Date: Tue Aug 22 13:57:56 2000
- Reply-to: clarkj@xxxxxxxxxxxxxxxx
On Tue, 22 Aug 2000, you wrote:
> ; $CHARS is not being expanded when enclosed within single quotes.
> ;
> ; try:
> ; sed -e "s?CHARS?$CHARS?g"
>
> firstly, you don't need the -e.
good point.
> secondly, there's no need for an
> alternate pattern/replacement seperator, sed is smart enough to
> recognise that when '$' is followed by something, it doesn't denote
> end of line.
this I know. But if the result of the variable expansion contains
the pattern/replacement seperator, the script will break (ie., if
$CHARS='foo/bar', "s/CHARS/$CHARS/g" fails).
--
Jim.