I see I can do
$ [ -w /home/durrantm ] && echo "writable" writable
$ test -w /home/durrantm && echo "writable" writable
$ [[ -w /home/durrantm ]] && echo "writable" writable
I 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?