[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: eval
From: |
Sven Mascheck |
Subject: |
Re: eval |
Date: |
Fri, 6 May 2011 00:29:09 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Wed, May 04, 2011 at 03:40:01PM -0500, Rafael Fernandez wrote:
> [...] I am used to the behavior of sh on NetBSD which does not require
> enclosing positional parameters. I believe it is adequately expressed in the
> manual page,
The NetBSD manpage documents it as usually implemented. I guess the
"unexpected" behaviour is rather a simple bug introduced on NetBSD
and the history (going offtopic now) was as follows:
The original ash '89 had not implemented or documented multi-digit
positional parameters at all (it was rather a SVR4 sh clone).
4.4BSD alpha '92 suddenly documented it,
"...braces, which are optional except for positional parameters
with more than one digit..."
http://www.in-ulm.de/~mascheck/various/ash/44bsdalpha.1.html
but interestingly had not implemented anything like that. And nothing
changed in later Berkeley variants.
NetBSD 1.2 '97 then just tried to fix this,
http://cvsweb.netbsd.org/bsdweb.cgi/src/bin/sh/parser.c#rev1.33 ff.
and apparently introduced the bug of handling $10 like ${10}.
The abovementioned sentence in the manpage was left unchanged.
Some ash variants were derived from NetBSD and inherited the bug, like
dash and busybox. Others were derived differently and behave as expected,
like FreeBSD, http://www.in-ulm.de/~mascheck/various/ash/ash.png
- Re: eval, (continued)
- Re: eval, DJ Mills, 2011/05/03
- Re: eval, Rafael Fernandez, 2011/05/05
- Re: eval, Jonathan Nieder, 2011/05/04
- Re: eval, Andreas Schwab, 2011/05/04
- Re: eval, Rafael Fernandez, 2011/05/05
- Re: eval, Chet Ramey, 2011/05/05
- Re: eval, Eric Blake, 2011/05/05
- Re: eval, Chet Ramey, 2011/05/05
- Re: eval, Eric Blake, 2011/05/05
- Re: eval, Chet Ramey, 2011/05/05
- Re: eval,
Sven Mascheck <=
- Re: eval, Chet Ramey, 2011/05/05
Re: eval, Greg Wooledge, 2011/05/04