I have the following script, basically a function and an IF
file_exists() {
if [ -f "$1" ]; then
return 0
else
return 1
fi
}
if [[ $(file_exists "LICENSE") ]]; then
echo "YES"
else
echo "NO"
fi
But this code always returns NO. I know the IF statement expects to get a 0 to be true, but I don't understand why it doesn't work