bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: export in posix mode


From: John Kearney
Subject: Re: export in posix mode
Date: Wed, 27 Feb 2013 22:52:38 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3

Am 27.02.2013 22:39, schrieb James Mason:
> On 02/27/2013 04:00 PM, Bob Proulx wrote:
>> Eric Blake wrote:
>>> James Mason wrote:
>>>> I certainly could be doing something wrong, but it looks to me like
>>>> bash
>>>> - when in Posix mode - does not suppress the "-n" option for export.
>>>> The version of bash that I'm looking at is 3.2.25.
>>> So what?  Putting bash in posix mode does not require bash to instantly
>>> prohibit extensions.  POSIX intentionally allows for implementations to
>>> provide extensions, and 'export -n' is one of bash's extensions.
>>> There's no bug here, since leaving the extension always enabled does
>>> not
>>> conflict with subset of behavior required by POSIX.
>> If you are looking to try to detect non-portable constructs then you
>> will probably need to test against various shells including ash.  (If
>> on Debian then use dash.)
>>
>>    https://en.wikipedia.org/wiki/Almquist_shell
>>
>> The posh shell was constructed specifically to be as strictly
>> conforming to posix as possible.  (Making it somewhat less than useful
>> in Real Life but it may be what you are looking for.)  It is Debian
>> specific in origin but should work on other systems.
>>
>>    http://packages.debian.org/sid/posh
>>    http://anonscm.debian.org/gitweb/?p=users/clint/posh.git;a=summary
>>
>> Bob
>
> We considered setting up another shell as the implementation of
> "/bin/sh", but that's hazardous in the context of vast amounts of
> boot-time initialization scripting that hasn't been vetted as to
> avoidance of bash-isms.
>
> Changing product script code - just so you can look for these sorts of
> things - isn't practical (or safe) either.
>
> So I guess if you take the view that bash POSIX mode exists only to
> make bash accept POSIX scripts, and not to preclude/warn about
> behavior that isn't going to be acceptable elsewhere, then you're
> right - it's not a bug.   If you care about helping people to be able
> to write scripts that work various places and don't exceed the POSIX
> specification, you're unhelpfully wrong (and you might contemplate why
> "bashisms" gives > 50K google hits).
>
> -jrm
>
>
>
bash posix more just changes bash behaviour that is incompatible with
the posix spec. Nothing more or less.
There are other shells for doing what you seem to want as has already
been stated.
Namely dash and posh.






reply via email to

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