这些在语法上有错误
[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
目前你离退伍还有天
____________________________________________________________
附上我的系统版本:
[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

附上我的脚本内容。
#!/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 "你已经退伍有"$((-1*$my_day))"了,属于老革命了"
else
        echo "目前你离退伍还有$my_day天"
fi