Bash脚本记要
Bash脚本记录
2.判断字符串是否包含某字符串
记录以下常用的shell命令。
1.Append output to files
[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.判断字符串是否包含某字符串
item="a.png" if [[ "$item" == *.png ]] then echo $item fi