Hi Andreas,
[Jean Delvare]
> > - -e '/^$/Q' \
> > + -ne '/^$/q;p' \
[Andreas Grünbacher]
> Objection. You git the semantics wrong:
>
> $ echo 'a' | sed -e '/a/Q'
> $ echo 'a' | sed -e '/a/p;q'
> > a
> > a
But:
$ echo 'a' | sed -ne '/a/q;p'
$
Which is what I was trying to do, and it seems to work. The test suite
still passes, at the very least.
> This should do the job though (don't leave out the {} grouping):
>
> - -ne '/^$/Q'
> + -ne '/^$/{d;q}'
Doesn't work at all in my tests (even with -e instead of -ne, which is
what you really meant I guess.) See by yourself:
$ cat test.txt
alpha
beta
gamma
delta
$ sed -e '/^$/Q' < test.txt
alpha
beta
$ sed -ne '/^$/q;p' < test.txt
alpha
beta
$ set -e '/^$/{d;q}' < test.txt
$
Thanks,
--
Jean Delvare
_______________________________________________
Quilt-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/quilt-dev