Bash string comparison at if statement
I'm becoming freaking crazy coz bash programming
I have the following:
result="ERROR|0" # From a complex sed exectution
IFS='|' read -a array <<< "$result"
if [ "${array[0]}" == "ERROR" ]; then
echo "Error"
fi
It should print Error, but it doesn't
Any ideas what I'm doing wrong?
No comments:
Post a Comment