Im new to bash and can't understand how the operator quite work here. The goal is to creating a script which ask user to input "y" to run the command or "n" to not run.
by using ==:
All inputs get passed such as (y, n, a, abc, etc..)
if (($TFENGINE_VAR==y))
by using =:
All inputs get rejected such as (y, n, a, abc, etc..)
if (($TFENGINE_VAR=y))
echo "run tfengine? (y/n)"
read TFENGINE_VAR
if (($TFENGINE_VAR==y))
then
echo "running tfengine command.."
sleep 1
tfengine --config_path=main.hcl --output_path=terraform/ -delete_unmanaged_files
else
echo "continue.."
continue
fi