Re: Which shell and how to get started handling arguments

Liste des GroupesRevenir à cu shell 
Sujet : Re: Which shell and how to get started handling arguments
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.unix.shell
Date : 16. Apr 2024, 19:54:54
Autres entêtes
Organisation : None to speak of
Message-ID : <87y19dqgsh.fsf@nosuchdomain.example.com>
References : 1 2 3 4
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Christian Weisgerber <naddy@mips.inka.de> writes:
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.

I stand corrected.

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.

There's also a "shellcheck" application, installable as a package on
Ubuntu and presumably many other systems.  I use it regularly, almost
always on scripts with "#!/bin/bash" so it doesn't check POSIX rules.
But when invoked on a script with "#!/bin/sh" or with "--shell=sh" it
claims to warn about POSIX portability issues.

https://github.com/koalaman/shellcheck

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Date Sujet#  Auteur
15 Apr 24 * Which shell and how to get started handling arguments26James Harris
15 Apr 24 +* Re: Which shell and how to get started handling arguments2Janis Papanagnou
15 Apr 24 i`- Re: Which shell and how to get started handling arguments1Janis Papanagnou
15 Apr 24 +* Re: Which shell and how to get started handling arguments4Christian Weisgerber
15 Apr 24 i`* Re: Which shell and how to get started handling arguments3Helmut Waitzmann
16 Apr 24 i `* Re: Which shell and how to get started handling arguments2Kaz Kylheku
16 Apr 24 i  `- Re: Which shell and how to get started handling arguments1Helmut Waitzmann
15 Apr 24 +- Re: Which shell and how to get started handling arguments1Ben Bacarisse
15 Apr 24 +* Re: Which shell and how to get started handling arguments16Lew Pitcher
15 Apr 24 i+* Re: Which shell and how to get started handling arguments4Christian Weisgerber
15 Apr 24 ii+* Re: Which shell and how to get started handling arguments2Kenny McCormack
15 Apr 24 iii`- Re: Which shell and how to get started handling arguments1Kaz Kylheku
15 Apr 24 ii`- Re: Which shell and how to get started handling arguments1Lew Pitcher
15 Apr 24 i`* Re: Which shell and how to get started handling arguments11Keith Thompson
16 Apr 24 i +- Re: Which shell and how to get started handling arguments1Janis Papanagnou
16 Apr 24 i `* Re: Which shell and how to get started handling arguments9Christian Weisgerber
16 Apr 24 i  +* Re: Which shell and how to get started handling arguments3Keith Thompson
16 Apr 24 i  i`* Re: Which shell and how to get started handling arguments2Kenny McCormack
16 Apr 24 i  i `- Re: Which shell and how to get started handling arguments1Christian Weisgerber
16 Apr 24 i  +* Re: Which shell and how to get started handling arguments2Kaz Kylheku
17 Apr 24 i  i`- Re: Which shell and how to get started handling arguments1Keith Thompson
17 Apr 24 i  `* Re: Which shell and how to get started handling arguments3Lawrence D'Oliveiro
17 Apr 24 i   +- Re: Which shell and how to get started handling arguments1Kenny McCormack
17 Apr 24 i   `- Re: Which shell and how to get started handling arguments1Christian Weisgerber
15 Apr 24 +- Re: Which shell and how to get started handling arguments1Helmut Waitzmann
16 Apr 24 `- Re: Which shell and how to get started handling arguments1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal