Linux shell script shebang env All In One
指定 shell script 的运行环境
shell script shebang
env
hash bang env
#!\usr\bin\env bash
❌
#!\usr\bin\env bash
# ❌
#!/usr/bin/env
✅
#!/usr/bin/env bash
✅
demos
#!/usr/bin/env bash
# ✅
export N=1
# case 1 数字
# suceess exit ✅
# ✅
case "$N" in
1)
echo 'case 1 数字';;
2)
echo 'case 2 数字';;
*)
echo 'default case 数字 *'
echo 'error exit ❌'
exit 1
;;
esac
echo 'suceess exit ✅'
exit 0