bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sed


From: Stephane Chazelas
Subject: Re: sed
Date: Tue, 13 Feb 2007 09:18:46 +0000
User-agent: Mutt/1.5.6i

On Tue, Feb 13, 2007 at 09:07:36AM +0000, Stephane Chazelas wrote:
[...]
>                 ALERT=`echo $TEMP | sed s//\\v/g`
> 
> You've got 4 errors in that single line.
[...]
> 4- You used an empty pattern (//)
> 
> For sed, an empty pattern means to reuse the previously used
> pattern. Here there isn't any
[...]

Sorry, I had not noticed there was actually a ^K between those
two "/".

To make it more visible, you could do:

VT=$(printf '\v')
sed "s/$VT/\\\\v"

(\ is special in double quotes as well so must be escaped one
more time than in single quotes, you need double quotes for the
shell to expand $VT to its content).

Or

sed s/"$VT"/'\\v'/

(for instance).

-- 
Stéphane




reply via email to

[Prev in Thread] Current Thread [Next in Thread]