1

I used to think [ would spawn /usr/bin/test and [[ was a builtin, but apparently, it doesn't:

$ strace bash -c " [ -z "$FOO" ] && echo yes " 2>&1 | grep test

and

$ type [
[ is a shell builtin

[ is a shorter and seems more portable too. I'm on GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu).

Petr Skocik
  • 28,816

0 Answers0