On Mon, Oct 31, 2022 at 11:24:06AM -0700, Roger Marquis wrote: > scott wrote: > >Historically, '[[' was implemented directly by the shell, while '[' > >was implemented using fork(), exec("["). There is clearly a benefit > >to eliminating process creation. > > Isn't that an implementation detail that can be easily changed? If so > not sure it'd be relevant to the compatibility or syntax issues with '[['.
The current standard allows the shell to treat any command as a builtin and execute it as such, so long as it preserves the semantics. However, another benefit of the '[[' builtin is that it does not do word splitting or pattern expansion. scott