当我尝试在shell脚本中实现if语句时,不知何故我遇到了这个问题,我想要做的是当输入选项为yes时,提示要求用户输入经度,纬度和宽度,如果输入不是是的,然后跳到最后。
#!/bin/bash
echo "Please enter keyword:"
read keyword
export keyword
echo "Do you want to search longitude and latitude? enter yes or no"
read option
if [[ $option=="yes" ]]; then
echo "Please enter longitude:"
read longitude
export longitude
echo "Please enter latitude:"
read latitude
export latitude
echo "Please enter width:"
read width
export width
fi