How to Set a Flag with Shell "If" Condition [Duplicate]

I am new to shell and I have never actually worked in it. I have a build script and i want to export a flag to "true" or "false" based on the condition in the if statement. My code is

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..

7
Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest