I want to check if the variable is equal to the true keyword and if it is then do something accordingly but it is behaving in an undefined way. don’t get what I want its a simple question but thank you : >
STRICT=$false
if [ "$STRICT" == $true ] # i am not sure about this line what should i do
then
FS="${FS} hey"
fi
>Solution :
Just use strings true and false, not variables.
STRICT=false
if [ "$STRICT" = true ]
then
FS="${FS} hey"
fi
And the standard string comparison operator is =. == is a bash extension.