判断某字符串里面是否包含一特定的字符串?

http://www.ajaxstu.com/Shellbiancheng/196427.html
命令:
 
a=abcdefg
b=`echo $a|grep -c efg`
if [ $b -eq 1 ];then
comand1
else
comand2
fi
posted @ 2014-11-04 10:10  程序员斯文  阅读(227)  评论(0)    收藏  举报