当前位置:网站首页>更改当前文件夹及文件夹下文件日期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边栏推荐
- Laravel8 uses passport login and JWT (generate token)
- Rainbow version 5.6 was released, adding a variety of installation methods and optimizing the topology operation experience
- 国标GB28181协议视频平台EasyGBS新增拉流超时配置
- 为什么要选择云原生数据库
- Automatic upgrading of database structure in rainbow
- [machine learning] watermelon book data set_ data sharing
- Ebpf cilium practice (1) - team based network isolation
- 2-3查找樹
- 测试踩坑 - 当已有接口(或数据库表中)新增字段时,都需要注意哪些测试点?
- grpc、oauth2、openssl、双向认证、单向认证等专栏文章目录
猜你喜欢

Opencv learning notes 1 -- several methods of reading images

快速集成认证服务-HarmonyOS平台
![[IELTS speaking] Anna's oral learning records part2](/img/c4/ad7ba2394ee7a52b67b643aa45a7ae.png)
[IELTS speaking] Anna's oral learning records part2
![[paper reading] icml2020: can autonomous vehicles identify, recover from, and adapt to distribution shifts?](/img/ff/81a7b2ec08a6a422a5cf578c1fed13.jpg)
[paper reading] icml2020: can autonomous vehicles identify, recover from, and adapt to distribution shifts?

Merge sort and non comparison sort

21 general principles of wiring in circuit board design_ Provided by Chengdu circuit board design

Are you holding back on the publicity of the salary system for it posts such as testing, development, operation and maintenance?

Interpreting the practical application of maker thinking and mathematics curriculum

如何在HarmonyOS应用中集成App Linking服务

Openvscode cloud ide joins rainbow integrated development system
随机推荐
基本数据类型和string类型互相转化
A single game with goods increased by 100000, and the rural anchor sold men's clothes on top of the list?
Download and install orcale database11.2.0.4
JEditableTable的使用技巧
南京商品房买卖启用电子合同,君子签助力房屋交易在线网签备案
POJ - 3616 Milking Time(DP+LIS)
[untitled]
联想混合云Lenovo xCloud:4大产品线+IT服务门户
为什么要选择云原生数据库
SSM 整合
Data type - floating point (C language)
Splunk子查询模糊匹配csv中字段值为*
The truth of robot education in hands-on practice
Fluentd is easy to use. Combined with the rainbow plug-in market, log collection is faster
Leetcode 1984. Minimum difference in student scores
redis故障处理 “Can‘t save in background: fork: Cannot allocate memory“
Merge sort and non comparison sort
GFS分布式文件系统
Open3D ISS关键点
Learn how to compile basic components of rainbow from the source code