Ray Andrews <rayandrews@xxxxxxxxxxx> writes:
I remember at one point I wanted to do a global replacement of [ with [[ and there were those places where things broke. Gotta rememberthese subtle differences.
Something to keep in mind is that `[` is a builtin and/or command, whereas `[[` is syntax:
$ whence -v [ [ is a shell builtin
$ whence -v [[ zsh: bad pattern: [[ (The entry for `test` in zshbuiltins(1) has more details.)Where `[` is a command, it's an alternate form of the `test` command, to the extent that on some systems they're actually the same binary. GNU Coreutils provides both `/usr/bin/[` and `/usr/bin/test`.
Alexis.