[H-GEN] Mail program

Greg Black gjb at gbch.net
Tue Jun 29 20:43:30 EDT 2004


On 2004-06-30, Anthony Towns wrote:
> On Sun, Jun 27, 2004 at 05:53:29PM +1000, Greg Black wrote:
> > On 2004-06-27, Anthony Towns wrote:
> > > Pfft, amateurs.
> > > 
> > >         sed -e ':x;s/^\( *>>*\)\(  *>\)/\1>/;tx;s/^\( *>>*\) */\1 /'
> > $ cat bar | sed -e ':x;s/^\( *>>*\)\(  *>\)/\1>/;tx;s/^\( *>>*\) */\1 /' > barbar
> > sed: 2: ":x;s/^\( *>>*\)\(  *>\) ...": unused label 'x;s/^\( *>>*\)\(  *>\)/\1>/;tx;s/^\( *>>*\) */\1 /'
> > You must be using some funny version of sed ...
> 
> *shrug* It's GNU sed 4.0.7. POSIX seems to require labels, and the s/// and t
> commands, so the only other problem you could maybe be having seems to be
> with the ; separator, which means you might have to do:
> 
>   $ sed -e ':x
>   s/^\( *>>*\)\(  *>\)/\1>/
>   tx
>   s/^\( *>>*\) */\1 /'
> 
> or
> 
>   sed -e ':x' -e 's/^\( *>>*\)\(  *>\)/\1>/' -e 'tx' -e 's/^\( *>>*\) */\1 /'

Both the above "work" in the sense that BSD sed is happy to
process them; the output is, of course, wrong.  But I don't know
if you meant to follow the specification here or not.

> Though why you'd want tools that force you through those sort of
> syntactic contortions when they're tools that just let you use the good
> ol' semi-colon is beyond me...

Like any normal person, I just want to use the standard tools
that are provided by my OS vendor; I certainly don't want to go
looking for non-standard variants of those tools.  This is, in
fact, one of the best reasons for going with my C solution.
It's easier to read than these sed scripts and it's a million
times more portable.

Cheers, Greg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 249 bytes
Desc: not available
URL: <http://lists.humbug.org.au/pipermail/general/attachments/20040630/1a214baf/attachment.sig>


More information about the General mailing list