- 论坛徽章:
- 2
|
- read -p "please input your damozilition date: " date2
- date_check=$(echo $date2 | grep '[0-9]\{8\}')
- if [ "$date_check" == "" ]; then
- echo "you input the wrong data format..."
- exit 1
- fi
- #declare -i date_dem=`date --date="$date2" +%s`
- #declare -i date_now=`date --date="date" +%s`
- #declare -i date_total_s=$(($date_dem-$date_now))
- #declare -i date_d=$(($date_total_s/60/60/24))
- #declare -i date_hour=$(($(($date_total_s - $date_d*24*60*60))/60/60))
- #declare -i date_sec=$(($date_total_s - $date_d*24*60*60 - $date_hour*60))
- #
- #if [ "$date_total_s" lt "0" ]; then
- # echo "You had been demolization " $date_d " days " $date_hour " hours " $date_sec "seconds"
- #else
- # echo "You will demolization after " $date_d " days " $date_hour " hours " $date_sec " seconds"
- #fi
复制代码 刚刚写的,很多错误,我把后面的都注释掉了,就是前面的那一小段代码也有问题,求助!!! |
|