shell脚本报错:"[: =: unary operator expected"
shell quot Operator expected
2023-09-11 14:16:39 时间
pid=`ps -ef|grep deploy|egrep -v 'grep'|awk -F '[ ]+' '{print $3}'` if [ $pid -ne 0 ] then kill $pid fi
上面脚本执行报错"[: =: unary operator expected"
需要把[ $pid -ne 0 ] 改为"[[ $pid -ne 0 ]]"即可
相关文章
- shell编程-----while、until、case、select语句
- [Android Pro] Android以root起一个process[shell脚本的方法]
- shell脚本执行时报"bad interpreter: Text file busy"的解决方法
- shell编程
- Shell - 简明Shell入门06 - 循环语句(Loop)
- Linux Shell脚本自动化编程实战-shell变量(一)
- Linux Shell脚本自动化编程实战- shell内置命令 break、continue
- [shell]Shell经常使用特殊符号
- lunix shell 基础经常使用整理
- Android shell 下 busybox,clear,tcpdump、、众多命令的移植
- linux shell 中"2>&1"含义
- Shell中获取脚本的绝对路径$( cd "$( dirname "$0" )" && pwd)
- shell脚本中 "set -e" 的作用
- shell编程中的单/双 小括号, 中括号, 大括号
- 21.第六章 Shell脚本编程基础入门-- shell 脚本语言的基本用法(四)
- 19.第六章 Shell脚本编程基础入门 -- shell 脚本语言的基本用法(二)
- 18.第六章 Shell脚本编程基础入门 -- 编程基础和shell脚本语言的基本用法(一)
- Shell脚本实战之文件批量创建和修改
- shell 脚本 脚本名称 参数
- shell 实例脚本
- linux bash shell 正则表达式
- shell - 02 - Shell的转折点:流程与控制
- shell - 09 - Shell文本处理三剑客 - sed -文件内容操作详解
- S4.shell脚本每日一练
- Shell全解析(一):Shell脚本
- jenkins执行本地/远程shell脚本
- shell之sleep指定延时单位(六)