我是 shell 脚本的新手,所以我有一个问题。我在这段代码中做错了什么?
#!/bin/bash
echo " Write in your age: "
read age
if [ "$age" -le "7"] -o [ "$age" -ge " 65" ]
then
echo " You can walk in for free "
elif [ "$age" -gt "7"] -a [ "$age" -lt "65"]
then
echo " You have to pay for ticket "
fi
当我试图打开这个脚本时,它会询问我的年龄,然后它说
./bilet.sh: line 6: [: 7]: integer expression expected
./bilet.sh: line 9: [: missing `]'
我不知道我做错了什么。如果有人能告诉我如何解决它,我将不胜感激,对不起我的英语不好,希望你们能理解我。