Prefer $(< ...) over $(cat ...) (@zendeavor).
Use != as it is available on Bash 3 (@havenwood).