Loading cart contents...
Bash shell笔记
记录关于Linux Shell Bash的笔记 ,供以后查阅使用
一,if的使用
if [ “$breakIndex” == “$index” ];then
echo “结束”
break
fi
二, Do的使用, 下面演示生成0001-1000的字符串
for index in `seq -w 1 1000`;
do内容
done
三,字符串的拼接
四,读取文件件并替换写入其中的字符串
echo “将修改的签名还原”
file=$(cat /Users/zhai/a.txt)fileReplaceAll=${file/google/$zhai}
echo “写入文件”
echo “$fileReplaceAll” > /Users/zhai/a.txt