[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Special built-ins not persisting assignments
From: |
Mike Frysinger |
Subject: |
Re: Special built-ins not persisting assignments |
Date: |
Tue, 25 Mar 2014 13:07:39 -0400 |
User-agent: |
KMail/4.12.3 (Linux/3.13.0; KDE/4.12.3; x86_64; ; ) |
On Tue 25 Mar 2014 00:39:18 Pollock, Wayne wrote:
> $ echo $BASH_VERSION
> 4.2.45(1)-release
>
> $ unset foo
>
> $ foo=bar :
>
> $ echo $foo
>
>
> $
>
> ===============
>
> According to POSIX/SUS issue 7, assignments for special builtins
> should persist. So the output should be ``bar''.
>
> Is there a setting I should turn off (or need to enable), to
> make this work correctly?
>
> I was able to confirm this bug for version 4.2.37(1)-release as
> well. (zsh 4.3.17 (i386-redhat-linux-gnu) has the same bug.)
as noted, this is a feature of bash :)
POSIX also imposes annoying behavior that bash fixes:
unset foo
f() { :; }
foo=bar f
echo $foo
POSIX will show bar (ugh) while bash will not (yeah!)
-mike
signature.asc
Description: This is a digitally signed message part.