nix-git/examples/case-esac.sh

14 lines
178 B
Bash
Raw Permalink Normal View History

2023-11-23 13:04:07 +01:00
#!/usr/bin/env bash
set -eu -o pipefail
x='some-test'
case "${x}" in
*'_'*|*'-'*)
echo "The string contains _ or -"
;;
*)
echo 'No pattern matched'
;;
esac