2022-10-31 12:00:24 -0700, Scott Lurndal via austin-group-l at The Open Group: [...] > However, another benefit of the '[[' builtin is that it does not > do word splitting or pattern expansion. [...]
"[" doesn't do word splitting of pathname expansion either, it's the shell that does if you forget to quote. For [[...]] not to do that, it needs to introduce a new language different from the usual shell one. Should we then introduce a: [ls -ld $file] construct, so we can leave $file unquoted and omit the -- there as well to list information from a file so we don't have to write ls -ld -- "$file"? And maybe a [echo foo\n$var], with again its own language to remove that old problem where echo "$var" fails for values of $var that start with - (with some implementations) or does unwanted escape expansions on the contents of $var. Note that though no word splitting is done inside [[...]] (except of course inside command substitutions within), it still does pattern matching. [[ $a = $b ]] still needs to be written [[ "$a" = "$b" ]] or at least [[ $a = "$b" ]] if you want to do byte-to-byte comparison. -- Stephane