[FZH] bash中如何测试子字符串?

LI Rui Bin cheeseli在hotmail.com
星期一 四月 19 17:04:06 UTC 2010


翻了一下书
也可以 test -z ${VAR##*kde*}
On 04/20/2010 12:33 AM, Chen Lei wrote:
> echo $VAR|grep -q kde
>
>
>
>
> 在2010-04-20 00:26:37,"LI Rui Bin"<cheeseli在hotmail.com>  写道:
>    
>> 我要在bash里测试一个字符串是否包含某个子串,该怎么写?比如测试 $VAR 中是
>> 否含有 "kde" 字样
>> _______________________________________________
>> Chinese mailing list
>> Chinese at lists.fedoraproject.org
>> https://admin.fedoraproject.org/mailman/listinfo/chinese
>>      
> _______________________________________________
> Chinese mailing list
> Chinese at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/chinese
>    



关于邮件列表 Chinese 的更多信息