目录
合理的写法
nio4444=true
if [ "$nio4444" = true ]; then
if [ "$nio4444" = "true" ]; then
if [[ "$nio4444" = true ]]; then
if [[ "$nio4444" = "true" ]]; then
if [[ "$nio4444" == true ]]; then
if [[ "$nio4444" == "true" ]]; then
if test "$nio4444" = true; then
if test "$nio4444" = "true"; then
本文探讨了在Linux Shell脚本中如何正确处理和使用boolean类型的变量,包括合理的方法和需要注意的陷阱,特别强调了处理变量未定义和为空的情况。
订阅专栏 解锁全文
2311

被折叠的 条评论
为什么被折叠?



