standards/181240: /bin/sh choking on a certain construct
Jens Schweikhardt
schweikh at schweikhardt.net
Mon Aug 12 21:10:03 UTC 2013
The following reply was made to PR standards/181240; it has been noted by GNATS.
From: Jens Schweikhardt <schweikh at schweikhardt.net>
To: Tamas TEVESZ <ice at extreme.hu>
Cc: freebsd-gnats-submit at FreeBSD.org
Subject: Re: standards/181240: /bin/sh choking on a certain construct
Date: Mon, 12 Aug 2013 23:06:43 +0200
On Mon, Aug 12, 2013 at 01:54:02PM +0000, Tamas TEVESZ wrote:
# >How-To-Repeat:
# /bin/sh -c 'echo foo || >&2 | cat'
#
# (Or, if you have misc/mc installed, hit ^[3 on a .diff/.patch/.so etc. file for which mc calls /usr/local/libexec/mc/ext.d/misc.sh)
A simpler invocation is
$ >x | cat
Syntax error: "|" unexpected
If I read the SUS shell grammar correctly, a lone redirection cannot be
a simple command in a pipe, so this is an extension that the other
shells accept. I'm not sure if this is a particular useful extension.
Regards,
Jens
--
Jens Schweikhardt http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)
More information about the freebsd-standards
mailing list