shell脚本中遇到if语句中的if["$1"="hello"] then.....时,却提示["$1"=hello] not found

2025-03-04 15:30:36
推荐回答(3个)
回答1:

if [ "$1" = "hello" ]; then

回答2:

注意空格

if [ $1 = "hello" ];then

回答3:

if["$1"=="hello"]