一品网
  • 首页

shell脚本系列:[[ ]]和[ ]的区别


test 或 []

  • [ -z "\$str1" ] || [ -z "$str2" ]
    • 正确
  • [ -z "\$str1" -o -z "$str2" ]
    • 正确
  • [[ -z \$str1 || -z $str2 ]]
    • 错误

[[ ]]

  • [[ -z \$str1 ]] || [[ -z $str2 ]]
    • 正确
  • [[ -z \$str1 -o -z $str2 ]]
    • 错误
  • [[ -z \$str1 || -z $str2 ]]
    • 正确
shell

相关


shell(5):expr使用

.net core 2.2 部署CentOS7(3)安装Xshell操控CentOS7

Shell脚本 全局变量、局部变量

linux:ssh管理端 shell

Shell 脚本编程

shell diff + kettle = mail 预警

shell 拼接html table 发送邮件

linux shell 删除满足正则表达式的文件

Xshell远程SSH报错:服务器发送了一个意外的数据包。RECEIVED:3,EXPECTED:20

绕不过去的正则(re)、shell的通配符

Linux---1.11.shell(环境变量配置文件)

Linux Shell获取CCTV5节目单

标签

一品网 冀ICP备14022925号-6