Bash脚本记录


Bash脚本记录
 
记录以下常用的shell命令。
 
1.Append output to files
 
[sql] 
[androidyue@androidyue tmp]$ touch 1.txt  
[androidyue@androidyue tmp]$ echo "11111" > 1.txt   
[androidyue@androidyue tmp]$ echo "22222" >> 1.txt   
[androidyue@androidyue tmp]$ cat 1.txt   
11111  
22222  
 
2.判断字符串是否包含某字符串
[plain] 
item="a.png"  
if [[ "$item" == *.png ]]  
then  
        echo $item  
fi  
 

相关内容

    暂无相关文章