[Top][All Lists]

[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..."
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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]