shell的问题
if[ "$1"=="hello" ];then
echo "Hello,how are you?"
elif[ "$1"=="" ];then
echo "You MUST input parameters, ex>$0 some word"
else
echo "The only parameter is 'hello'"
fi
这语法有错吗?为什么总是报这样的错误?
sh08.sh: line 9: syntax error near unexpected token `then'
sh08.sh: line 9: `if[ "$1"=="hello" ];then'
echo "Hello,how are you?"
elif[ "$1"=="" ];then
echo "You MUST input parameters, ex>$0 some word"
else
echo "The only parameter is 'hello'"
fi
这语法有错吗?为什么总是报这样的错误?
sh08.sh: line 9: syntax error near unexpected token `then'
sh08.sh: line 9: `if[ "$1"=="hello" ];then'
...全文
相关推荐
Shell中函数返回值超出问题
本文将深入探讨这个“Shell中函数返回值超出问题”,以及如何理解和避免它。1.
解决Unity不能调用shell脚本传递参数的问题
#### 问题描述根据题目中的描述,我们遇到的问题是:Unity不能正确地调用shell脚本并将参数传递给脚本。
浅谈shell循环中变量的作用域问题
在Shell脚本编程中,变量的作用域是一个非常重要的概念,尤其是在涉及到循环结构时。本文将深入探讨Shell循环中变量的作用域问题,以及如何避免由此产生的潜在陷阱。
Shell脚本cd问题解析[代码]
在这种情况下,如果确实需要改变目录,就应该在脚本执行完毕后,手动将目录切换回原始状态,或者使用其他方法来避免子shell带来的问题。Shell脚本中的cd命令问题主要由子shell环境的特性导致。
非常好的12道shell命令经典面试问题
在IT领域,尤其是在系统管理、自动化和开发工作中,熟悉Shell脚本是至关重要的。以下是对提供的12道Shell命令经典面试问题的详细解答:1.


