[nycbug-talk] Optional Variable Assignments and Builtins in ``Simple Commands''

Matthew Story matthewstory at gmail.com
Thu May 3 14:41:38 EDT 2012


On Thu, May 3, 2012 at 1:32 PM, Jan Schaumann <jschauma at netmeister.org>wrote:

> Matthew Story <matthewstory at gmail.com> wrote:
>
> > I decided to take Jan's advice and "test all the things" in bash, dash
> and
> > FreeBSD sh:
>
> Nice follow-up!
>

One odd bit here is that the functionality for functions is the same as
built-ins per shell:

bash $ hi() { echo "$HI"; }
bash $ HI=HELLO hi
HELLO
bash $ echo "$HI"

dash $ hi() { echo "$HI"; }
dash $ HI=HELLO hi
HELLO
dash $ echo "$HI"
HELLO
freebsd sh $ hi() { echo "$HI"; }
freebsd sh $ HI=HELLO hi
HELLO
freebsd sh $ echo "$HI"
HELLO

whereas the specification only exempts special built-ins from setting
current environment.  I think this is likely an omission in the
specification, I have submitted this as a bug to the Austin Group

http://austingroupbugs.net/view.php?id=562


>
> -Jan
>
> _______________________________________________
> talk mailing list
> talk at lists.nycbug.org
> http://lists.nycbug.org/mailman/listinfo/talk
>
>


-- 
regards,
matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.nycbug.org:8443/pipermail/talk/attachments/20120503/27872a9e/attachment.htm>


More information about the talk mailing list