-bash: [: @: binary operator expected
问题 all, I am checking the error info in a file in the last line, I would like to have a "yes" result if there is an "Error". My shell script is like below: [ $(tail -1 error.log | grep -E "Error") ] && echo "yes" then I got the error like above in the title: -bash: [: @: binary operator expected The error message in the last line is like below: [aaa,bbb,ccc, Error.ddd @ ] I think that is because of the the Error message, which has [ @ ] format content caused this error. But I do not know how to