Web lists-archives.com

Re: [Mingw-msys] Reconstruction of MSYS-1.0.11 test results - sed.

On 2008-06-27 18:49Z, SUNIL NEGI wrote:
> While compiling libiconv on msys environment, I found the following line
> throws an error:
> snegi1@xxxx ~/dlds/libiconv-1.12
> $ echo "1.12" | sed -n -e "/^[0-9]/{s/^\([0-9]*\).*/\1/p;q}"
> sed: -e expression #2, char 32: Extra characters after command

Many MSYS 'sed' problems arise from MSYS's path translation:
but I think this one is different. This slightly-altered
testcase works:

$echo "1.12" | sed -n -e "s|^\([0-9]*\).*|\1|p;q"

but this one fails with a message such as you quoted:

$echo "1.12" | sed -n -e "{s|^\([0-9]*\).*|\1|p;q}"

but neither uses any '/' character. So I would guess the
problem is that this 'sed':

> $ sed --version
> GNU sed version 3.02

is just too old. I get the same error if I put the command
in a file and invoke it with 'sed -f'. You can try writing
the command a little differently; e.g., this seems okay:

echo "1.12" | sed -n -e "/^[0-9]/s/^\([0-9]*\).*/\1/p"

and I don't see why anyone would write 'q' here anyway.

Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
Mingw-msys mailing list