In my Makefile I have something like this
BREW?=/opt/homebrew/bin/brew
What would the equivalent of this be in a standard shell command ? What the above does is checks if the environment variable BREW has been defined. If it is then it uses that value otherwise it uses the assigned value.
How would I translate the above in a standard shell statement I am doing this
env | grep BREW > /dev/null
if [ $? -eq 0 ];then
export BREW=$BREW
else
export BREW=/opt/homebrew/bin/brew
fi
echo "The path of brew is : $BREW"
It does not print the last statement BREW