Afficher un message
Vieux 21/12/2007, 15h53   #7
Michael Tosch
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sed: s/// not an address?

Stephane Chazelas wrote:
> On Fri, 21 Dec 2007 13:55:46 +0100, Michael Tosch wrote:
> [...]
>> /regexp/{s/regexp/replacement/;h;}

>
> or
>
> /regexp/{s//replacement/;h;}
>
>> or
>>
>> !s/regexp/replacement/;tL1

>
> ! is only run a command if the address range does *not* match.
> You can't use it to negate the meaning of the "s" commands wrt
> t.
>
>> h
>> :L1
>> /$1/{g;}

> [...]
>
> Instead:
>
> s/regexp/replacement/; t2
> :1
> /$1/{g;}
> d
> :2
> h
> b1
>


Then, at least,
one should omit the d (or n) command:

s/regexp/replacement/; t1
b2
:1
h
:2
/$1/{g;}


--
Michael Tosch @ hp : com
  Réponse avec citation
 
Page generated in 0,04626 seconds with 9 queries