当前位置:网站首页>busybox date 日期增加一天明天 网上都是减一天 昨天
busybox date 日期增加一天明天 网上都是减一天 昨天
2022-07-17 05:12:00 【xp5xp6】
#!/bin/bash
y_begin=$1
m_begin=$2
d_begin=$3
y_end=$4
m_end=$5
d_end=$6
echo $y_begin $m_begin $d_begin
echo $y_end $m_end $d_end
tmp=""
tomorrowday=""
begin="$y_begin$m_begin$d_begin"
echo $begin
end="$y_end$m_end$d_end"
echo $end
year=$y_begin
month=$m_begin
day=$d_begin
echo ${year} ${month} ${day}
fun_next_day()
{
#echo "---${year} ${month} ${day}"
if [[ "$day" == "31" ]];then
if [[ "$month" == "12" ]];then
day="01"
month="01"
year=`expr $year + 1`
elif [[ "$month" == "01" || "$month" == "03" || "$month" == "05" || "$month" == "07" || "$month" == "08" || "$month" == "10" ]];then
day="01"
month=`expr ${
month} + 1`
month=$(printf "%02d" "$month")
fi
elif [[ "$day" == "30" ]];then
#echo "--30-----"
if [[ "$month" == "04" || "$month" == "06" || "$month" == "09" || "$month" == "11" ]];then
#echo "--31-----"
day="01"
month=`expr ${
month} + 1`
month=$(printf "%02d" "$month")
else
#echo "--32-----"
day=`expr $day + 1`
day=$(printf "%02d" "$day")
#echo "day------$day"
fi
elif [[ "$day" == "29" && "$month" == "02" ]];then
day="01"
month=`expr ${
month} + 1`
month=$(printf "%02d" "$month")
tomorrowday="${year}${month}${day}"
elif [[ "$day" == "28" && "$month" == "02" ]];then
year_type=`expr ${
year} % 4`
if [[ "$year_type" == "0" ]];then
day=`expr $day + 1`
day=$(printf "%02d" "$day")
else
day="01"
month=`expr ${
month} + 1`
month=$(printf "%02d" "$month")
fi
else
day=`expr $day + 1`
day=$(printf "%02d" "$day")
#echo "day---$day"
fi
tomorrowday="${year}${month}$day"
echo $tomorrowday
#echo "end ---${year} ${month} ${day}"
#return $tomorrowday
}
echo "----------begin------"
echo $end
while [ "$begin" != "$end" ]
do
echo "begin--- $begin"
cp -rvf 20200509 $begin
fun_next_day
begin=$tomorrowday
#sleep 1
done
边栏推荐
- HRA 1~12W 系列12V《宽压9~18V》转±250VDC等升压变换器
- HRA 1~12w series 12V wide voltage 9~18v to ± 250VDC boost converter
- MySQL workbench basically uses [create a database]
- QTSS回调例程
- KU115 FPGA 高性能万兆光纤网络硬件加速卡 / 2 路 10G 光纤数据加速卡
- 新产品如何选型Flash?
- MCU单片机OTP
- 解决Cannot read properties of null (reading ‘pickAlgorithm‘)
- 5V升压充电8.4V芯片
- 为什么方案商“钟情”选择CS创世SD NAND
猜你喜欢

自动补全 & (自定义)拼音分词器 & 搜索时注意事项

4 路 FMC 接口基带信号处理板(2 个FMC接口、2个FMC+接口)

MySQL Workbench基本使用【创建一个数据库】

4 路 FMC+基带信号处理板( 4 路 2G 瞬时带宽 AD+DA)

3.7V锂电池升压到5V1A,FS2114升压转换芯片设计布局

简单Chrome脚本 自动跳过b站视频播放结束后的的充电鸣谢页面
![[simple and fast] after startup, the desktop is normal, and the taskbar below is unresponsive / the mouse keeps turning](/img/65/fbb975491d4abd5d1babdf000513e2.png)
[simple and fast] after startup, the desktop is normal, and the taskbar below is unresponsive / the mouse keeps turning

High voltage module isolation module hra2460d-2w

2021-09-15

Xinlinx zynq7010国产替代 FMQL10S400 全国产化 ARM 核心板+扩展板
随机推荐
[detailed tutorial installation] [configuration] auxiliary plug-ins about eslint in vscode
Xilinx UltraScale+ MPSOC(ZU9EG/ZU15EG)高性能 PCIe 数据预处理板
MCU single chip OTP
压力应变桥信号处理光电隔离放大器
2021-11-17 ESP32引脚参考
基于 UltraScale FPGA+华为海思 ARM 的高性能综合视频图像处理板 / FPGA+ARM
TP4054充电IC使用技巧---配合中科蓝讯AB5365B使用
Chrome浏览器设置 【显示右上角 翻译语言图标】
FS68001无线充SOC芯片外围简单,5W无线充方案原理图
Chrome browser settings [display the translation language icon in the upper right corner]
QTSS常数
Boost dc/dc converter
【转】Darwin Streaming Server 核心代码分析
vscode 配置golang开发环境
Golang multi project workspace construction
EasyDarawin流媒体服务器介绍
[speech recognition] Kaldi installation experience
MySQL workbench basically uses [create a database]
Fs4061a (5V USB input, double lithium battery series application, 5V boost charging, 8.4v Management IC
MySQL workbench basically uses [create a data table]