摘要:        
shell判断数组中是否包含某个元素: ary=(1 2 3) a=2 if [[ "${ary[@]}" =~ "$a" ]] ; then echo "a in ary"else echo "a not in ary"fi 判读字符串($str)是否包含另一个字符串($str1): 方法1: i    阅读全文
posted @ 2017-01-24 15:32
kszsa
阅读(239)
评论(0)
推荐(0)
        
            
        
        
摘要:        
if [ str1 = str2 ] 当两个串有相同内容、长度时为真 if [ str1 != str2 ] 当串str1和str2不等时为真 if [ -n str1 ] 当串的长度大于0时为真(串非空) if [ -z str1 ] 当串的长度为0时为真(空串) if [ str1 ] 当串st    阅读全文
posted @ 2017-01-24 15:23
kszsa
阅读(640)
评论(0)
推荐(0)
        
 
                    
                     
                    
                 
                    
                
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号