Re:Zsh is your friend.
by pyre on Tuesday January 31, 2012 @03:22PM
(#3534995)
[ ] is easy. It's just the 'test' command.[1]
% which \[
/usr/bin/[
All of the other syntax is shell-specific (run via built-ins), so that can vary, and be a little more obtuse.
[1] Albiet with some minor differences:
% if [ -d /tmp ]; then echo "TRUE"; fi
TRUE
% if test -d /tmp ]; then echo "TRUE"; fi
test: too many arguments
% if test -d /tmp; then echo "TRUE"; fi
TRUE
% diff /usr/bin/{test,\[}
Binary files /usr/bin/test and /usr/bin/[ differ
% man \[
No manual entry for [
[1] Albiet with some minor differences: