Never use a && b || c. It is not the same as if a; then b; else c; fi: when a succeeds but b fails, it will run both b and c.
I would not bother with [ unless you absolutely need compatibility with non-bash shells.
Never use a && b || c. It is not the same as if a; then b; else c; fi: when a succeeds but b fails, it will run both b and c.
I would not bother with [ unless you absolutely need compatibility with non-bash shells.