下面的linux shell脚本中的 $#和-ne是什马意思吗?求指教。
if[$#-ne2];thenecho"Usage:$0match_textfilename"exit1fimatch_text=$1filename=$2grep-q"...
if [ $# -ne 2 ]; then
echo "Usage: $0 match_text filename"
exit 1
fi
match_text=$1
filename=$2
grep -q "$match_text" $filename 展开
echo "Usage: $0 match_text filename"
exit 1
fi
match_text=$1
filename=$2
grep -q "$match_text" $filename 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询