1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#!/bin/bash dt1=`date -d "2021/04/26 19:36:59" "+%s"` dt2=`date -d "2021/04/26 19:37:09" "+%s"` echo $(($dt2-$dt1)) if [ $(($dt1+10)) -eq $dt2 ]; then echo "000" elif [ $(($dt1+10)) -gt $dt2 ]; then echo "111" elif [ $(($dt1+10)) -lt $dt2 ]; then echo "222" fi if [ $(($dt1+10)) -ge $dt2 ]; then echo "1212" else echo "1313" fi |
スポンサーリンク