日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

[待解决]报错的脚本

發(fā)布時間:2025/3/19 编程问答 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [待解决]报错的脚本 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

這些在語法上有錯誤
[root@centos home]# ./03.sh
這個程序旨在幫助你知道你的退伍日期(例如20100909)
輸入你的退伍日期==>:20100909
./03.sh: line 15: declare: date +%s: syntax error: operand expected
(error token is "%s")
./03.sh: line 16: declare: date --date="$some" +%s: syntax error in
expression (error token is "date="$some" +%s")
./03.sh: line 17: declare: $(($some_time-$now_time)): syntax error:
operand expected (error token is "$(($some_time-$now_time))")
./03.sh: line 18: declare: $(($my_s/60/60/24)): syntax error: operand
expected (error token is "$(($my_s/60/60/24))")
./03.sh: line 20: [: -lt: unary operator expected
目前你離退伍還有天
____________________________________________________________
附上我的系統(tǒng)版本:
[root@centos home]# uname -a
Linux centos 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT 2010 i686 i686
i386 GNU/Linux

附上我的腳本內(nèi)容。
#!/bin/bash
#this is a test script
#made by chenbaocheng?? ctime:2010/8/25
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin/:~/bin
export PATH

echo "這個程序旨在幫助你知道你的退伍日期(例如20100909) "
read -p "輸入你的退伍日期==>:" some
test -z "$some" && echo "不輸名字是不行的" && exit 0
some2='echo $some | grep '[0-9]\{8\}''
if? [ "$some2" = "" ]; then
????????echo "你的輸入有問題,請重新再來"
fi
declare -i now_time='date +%s'
declare -i some_time='date --date="$some" +%s'
declare -i my_s='$(($some_time-$now_time))'
declare -i my_day='$(($my_s/60/60/24))'

if ["$my_day" -lt "0" ];then
????????echo "你已經(jīng)退伍有"$((-1*$my_day))"了,屬于老革命了"
else
????????echo "目前你離退伍還有$my_day天"
fi
?

轉(zhuǎn)載于:https://blog.51cto.com/myhat/382811

總結(jié)

以上是生活随笔為你收集整理的[待解决]报错的脚本的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。