stefanhusmann schriebWobei es auch eine switch-Anweisung in bash gibt, und die case-Anweisung sogar als "deprecated" markiert ist.
Jup. Wieder was gelernt. Werde gleich erstmal meine Shellskripte refactorn.
$ man case | grep Note
Note: the case command is obsolete and is supported only for backward compatibility. At some point in the future it may be removed entirely. You should use the switch command instead.
Update:
Alles zurück. Das sind die Handbuchseiten der Tcl. Betrifft also gar nicht die Bash.
In Bash gilt weiterhin
case. Ein
switch Kommando kennt meine bash nicht.
$ help case
case: case Wort in [Muster [| Muster]...) Kommandos ;;]... esac
Execute commands based on pattern matching.
Selectively execute COMMANDS based upon WORD matching PATTERN. The
`|' is used to separate multiple patterns.
Exit Status:
Returns the status of the last command executed.