Re: Proposed new POSIX sh policy
Bruce Sass <bmsass@shaw.ca> writes:
> Scripts specifying /bin/sh as their command interpreter (shell) must
> only use SUSv3[1] features or the following exceptions:
>
> - echo -n [2]
> - [ x -a y ] [3]
> - ... [4]
>
> Thus, the only shells allowed to be /bin/sh are those which are SUSv3
> compliant and implement the allowed exceptions to SUSv3. If a script
> requires non-SUSv3 features not explicitly excepted, the appropriate
> shell must be specified in the first line of the script (e.g.,
> #!/bin/bash) and the package must depend on the package providing the
> shell (unless the shell package is marked "Essential", as in the case
> of bash).
>
> [1] http://www.opengroup.org/onlinepubs/009695399/ POSIX, XSI, whatever
> [2] whatever its problem is
> [3] why -a is allowed
Make it a recommendation to use:
[ x ] && [ y ]
as alternative to "-a". The "-a" may cause problems because it does
not short circuilt, like the && would. Lintian could give a warning
and suggest maintainers to consider the "&&" choice.
Too bad lintian doesnät have "--pedantic" equivalent of gcc.
Jari
Reply to: