当前位置:网站首页>更改当前文件夹及文件夹下文件日期shell脚本
更改当前文件夹及文件夹下文件日期shell脚本
2022-07-07 05:52:00 【陈哆肉&J】
#!/bin/bash
function changeName(){
#new=`echo $1|sed 's/^/abc/g'`
#new=`echo $1|sed -r 's/abc(.*$)/\1/g'`
new=`echo $1|sed -r 's/20220630/20220707/g'`
##以602结尾的进行替换
new1=`echo $1|sed -r 's/630$/707/g'`
##以0601.DBF类似的文件进行替换
new2=`echo $1|sed 's/0630/0707/g'`
echo changeName old: $1 new: $new
if [ $1 != $new ];then
mv $1 $new
fi
echo changeName old: $1 new: $new1
if [ $1 != $new1 ];then
mv $1 $new1
fi
echo changeName old: $1 new: $new2
if [ $1 != $new2 ];then
mv $1 $new2
fi
}
function travFolder(){
#echo "travFolder start"
flist=`ls $1`
cd $1
for f in $flist
do
#echo traverse do $f
local old=$f
if test -d $f
then
#echo "traverse dir:${f}"
travFolder $f
#echo "traverse rename dir:${f}"
changeName $old #新加的rename文件夹名字
else
#echo "traverse file:$f"
changeName $f
fi
done
cd ../
}
param=$1
if [ -z "$1" ]
then
param="./20220707"
echo "empty string: $param"
else
param=$1
fi
cp -r ./20220630 ./20220707
travFolder $param保存为 changedate.sh文件
命令执行
sh changedate.sh边栏推荐
- Leetcode 1984. Minimum difference in student scores
- 接口作为参数(接口回调)
- One click installation of highly available Nacos clusters in rainbow
- Fluentd is easy to use. Combined with the rainbow plug-in market, log collection is faster
- 字符串操作
- Le système mes est un choix nécessaire pour la production de l'entreprise
- mysql分区讲解及操作语句
- 南京商品房买卖启用电子合同,君子签助力房屋交易在线网签备案
- How to understand distributed architecture and micro service architecture
- AVL平衡二叉搜索树
猜你喜欢

Rsync remote synchronization

Famine cloud service management script

国标GB28181协议视频平台EasyGBS新增拉流超时配置

Practice of combining rook CEPH and rainbow, a cloud native storage solution

关于基于kangle和EP面板使用CDN

opencv学习笔记二——图像基本操作

The single value view in Splunk uses to replace numeric values with text

Rainbow version 5.6 was released, adding a variety of installation methods and optimizing the topology operation experience

AVL平衡二叉搜索树

Openvscode cloud ide joins rainbow integrated development system
随机推荐
23 Chengdu instrument customization undertaking_ Discussion on automatic wiring method of PCB in Protel DXP
MySQL introduction - crud Foundation (establishment of the prototype of the idea of adding, deleting, changing and searching)
String operation
Componentspace2022, assertions, protocols, bindings, and configuration files
Download and install orcale database11.2.0.4
详解华为应用市场2022年逐步减少32位包体上架应用和策略
Train your dataset with swinunet
Composer change domestic image
MES系统,是企业生产的必要选择
調用華為遊戲多媒體服務的創建引擎接口返回錯誤碼1002,錯誤信息:the params is error
Basic data types and string types are converted to each other
单元测试报告成功率低
Ebpf cilium practice (2) - underlying network observability
使用BiSeNet实现自己的数据集
测试踩坑 - 当已有接口(或数据库表中)新增字段时,都需要注意哪些测试点?
[untitled]
调用华为游戏多媒体服务的创建引擎接口返回错误码1002,错误信息:the params is error
Interface as a parameter (interface callback)
接口作为参数(接口回调)
使用SwinUnet训练自己的数据集