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