I see I can do$ [ -w /home/durrantm ] && echo writablewritableor$ test -w /home/durrantm && echo writablewritableor$ [[ -w /home/durrantm ]] && echo writablewritableI like using the third syntax. Are they equivalent in all ways and for all negative and edge cases? Are there any differences in portability, e.g. between bash on Ubuntu and on OS X or older/newer bash versions, e.g. before/after 4.0 and do they both expand expressions the same way?
Is test or [ or [[ more portable both between bash shells and between other shells?
shell;posix;test;portability
[ is synonym of the test command and it is simultaneously a bash builtin and separate command. But [[ is a bash keyword and works in some versions only. So for reasons of portability you are better off using single [] or test [ -w /home/durrantm ] && echo writable