加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
change_prefix_suffix.sh 560 Bytes
一键复制 编辑 原始数据 按行查看 历史
hihopeci 提交于 2020-05-23 16:11 . fresh
# $1 pre or suf
# $2 str
# $3 add or del
# for files in `ls *`;do mv ${files} ${files}.aaa;done
# for files in `ls *`;do mv $files `echo $files | sed 's/aaa//'`;done
if [[ "$1" == "pre" ]];then
if [[ "$3" == "add" ]];then
for files in `ls *`
do
mv ${files} $2${files}
done
else
for files in `ls *`
do
mv ${files} `echo $files | sed `s/^$2//``
done
fi
else
if [[ "$3" == "add" ]];then
for files in `ls *`
do
mv ${files} ${files}$2
done
else
for files in `ls *`
do
mv ${files} `echo $files | sed `s/$2//``
done
fi
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化