今天看啥
热点:

echo "the scripts name is ==>$0"echo "total parameter number is ==>s#"[ "$#" -lt 2 ] && echo "the number of parameter is les than 2. stop here."\&& exit 0echo "your whole parameter is ==>'$@'"echo "the 1st parameter ==> $1"echo "the 2nd parameter ==>$2"
请问[ "$#" -lt 2 ] && echo "the number of parameter is les than 2. stop here."\&& exit 0这是什么意思?没看太明白,重点是[]里的东西!
最佳答案

[ ]是条件测试
$#是参数变量意思是参数的个数
-lt是 “小于”的意思
[ "$#" -lt 2 ] 就是测试 参数的个数小于2 这个条件,

回答者:

www.bkjia.comtruehttp://www.bkjia.com/guzhang/guzhang31779.htmlTechArticleecho "the scripts name is ==$0"echo "total parameter number is ==s#"[ "$#" -lt 2 ] echo "the number of parameter is les than 2. stop here."\ exit 0echo "your whole parameter is =='$@'"echo "the 1st parameter == $1"echo "the 2nd parameter ==...

相关文章

相关搜索: linux shell scripts
相关频道:

帮客评论

视觉看点