Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the simply-static domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wp-includes/functions.php on line 6121
学习 linux shell脚本

学习 linux shell脚本

长期以来一直是windows的忠实用户,但发现做嵌入式很难脱离linux,只能苦命学linux,最近被日期形式的文件名困扰,一直想实现通过日期形成抓拍图片文件名,磁盘满了自动按时间顺序清楚,也就是先进先出方式,终于通过shell的bash实现了这点。

#!/bin/bash
var1=$(date +'%Y-%m-%d')
var2=$(date +%Y%m%d)
var3=$[$var2-2]
echo $var1
echo $var2
echo $var3

参考https://www.cnblogs.com/wanng/p/14105935.html

#!/bin/bash
h="hello"
hw=${h}" world"
echo ${hw}
var1=$(date +'%Y-%m-%d')
var2=$(date +%Y%m%d)
var3=$[$var2-2]
var4=$[$var2+5]
var5="*"
echo $var1
echo $var2
echo $var3
echo $var4
var5=$(date +%d $date)
h1="*"
hw1=$var4${h1}
ls $hw1.jpg -l