如何在shell“如果”条件下设置标志

我是Shell的新手,但我从未真正使用过它。我有一个构建脚本,我想根据if语句中的条件将标志导出为“ true”或“ false”。 我的代码是

echo "Is the Build with GAPPS?(arm64 only)"
set_gapps_build=false
select yn in "Yes" "No"; do
case $yn in   
        Yes ) set_gapps_build=true;
        break;;
        No ) set_gapps_build=false;
        break;;
    esac
done
if [ "$set_gapps_build" = true ] ; then
        export SAKURA_GAPPS=true
        export TARGET_GAPPS_ARCH=arm64
fi

If i choose true, the flag should be set to true but its not working. It remains to false. Incase you want to see the whole shell code its here.. https://raw.githubusercontent.com/LordShenron/build/master/build

评论