Sujet : Re: Which shell and how to get started handling arguments
De : naddy (at) *nospam* mips.inka.de (Christian Weisgerber)
Groupes : comp.unix.shellDate : 16. Apr 2024, 12:11:16
Autres entêtes
Message-ID : <slrnv1sn6k.25p4.naddy@lorvorc.mips.inka.de>
References : 1 2 3
User-Agent : slrn/1.0.3 (FreeBSD)
On 2024-04-15, Keith Thompson <Keith.S.Thompson+
u@gmail.com> wrote:
Bash has an option that tells it to (attempt to) restrict itself to
POSIX semantics:
No, it does not:
Starting Bash with the '--posix' command-line option or executing
'set -o posix' while Bash is running will cause Bash to conform more
closely to the POSIX standard by changing the behavior to match that
specified by POSIX in areas where the Bash default differs.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This only tweaks bash's behavior where it otherwise differs from
POSIX. It does not disable the myriad extensions.
There is a tool ShellCheck that among other things can be used to
warn about unportable code in shell scripts.
https://www.shellcheck.net/I haven't used it myself yet. It is written in Haskell, so it
suffers itself from portability concerns.
-- Christian "naddy" Weisgerber naddy@mips.inka.de