Files
tldr/pages.it/common/case.md
K.B.Dharun Krishna f1aa0a8fe5 Revert "pages/*: add standard translation and links (#11331)" (#11374)
This reverts commit 39642c3fed80aaed7212bca6b7cc4c345ed229ee.
2023-11-06 14:02:32 +05:30

500 B

case

Esegui branch diversi in base al valore di un'espressione. Maggiori informazioni: https://manned.org/case.

  • Esegui il match di una variabile su diverse stringhe per decidere che comando eseguire:

case {{$metrica}} in {{parole}}) {{wc -w README}}; ;; {{linee}}) {{wc -l README}}; ;; esac

  • Combina pattern con |, utilizzando * come pattern di fallback:

case {{$metrica}} in {{[pP]|parole}}) {{wc -w README}}; ;; {{[lL]|linee}}) {{wc -l README}}; ;; *) {{echo "cosa?"}}; ;; esac