1. 计算开学到现在过了多少天
[root@deem scripts]# cat rili.sh
#!/bin/bash
. /etc/profile
#D=`echo date +%Y%m%d`
#Y=`2019-01-01`
#awk 'BEGIN{print $D - 20190101}'
A=`echo date --date=20181122 +%s`
B=`echo date +%s`
echo $(((`$B`-`$A`)/60/60/24))
#echo `$D`-20181122 |bc
[root@deem scripts]# sh rili.sh
200
[root@deem scripts]# cat rili2.sh
#!/bin/bash
. /etc/profile
date +%F_%w_%T
echo ' 大哥,你在这呆了'`sh /server/scripts/rili.sh`'天了'
echo '
.=""=.
/ _ _ \
| d b |
\ /\ /
,/'-=\/=-'\,
/ / 爱 \ \
| / 情 \ |
\/ \ XX / \/
'. .'
_|`~~`|_'
标签:开学,+%,echo,sh,计算,scripts,date,deem,多少
From: https://www.cnblogs.com/megshuai/p/18492955