last modified by zhoutianju , 2023-06-02 00:54:42
常用脚本片段
如果上一个命令执行失败
if [ $? -ne 0 ]; then
echo "failed"
fi
判断输入参数
if [ $# -gt 0 ];then
echo "arg[1]: $1"
fi
替换 HTML 中的特殊字符
sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g'
Copyright © 2023 zhoutianju.
All rights reserved.
All rights reserved.