[Top][All Lists]
[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
- sed, Conner, Neil, 2007/02/12
- Re: sed, Stephane Chazelas, 2007/02/13
- Re: sed,
Stephane Chazelas <=
- Re: sed, Matthew Woehlke, 2007/02/13
- Message not available
- Re: sed, Stephane Chazelas, 2007/02/13
- Re: sed, Matthew Woehlke, 2007/02/13
- Message not available
- Re: sed, Stephane Chazelas, 2007/02/14
- Re: sed, Matthew Woehlke, 2007/02/14
- Message not available
- Re: sed, Stephane Chazelas, 2007/02/15
Re: sed, Ralf Wildenhues, 2007/02/13
- RE: sed, Conner, Neil, 2007/02/13
- Re: sed, Stephane Chazelas, 2007/02/14
Re: sed, Stephane Chazelas, 2007/02/14