3 ms·
When I benchmarked it, I saw no difference between [ and [[ when using bash, so I assume [ is handled (now) by the shell as well. The syntax inside [[ is diffe
by mulle_nat 2y ago
When I benchmarked it, I saw no difference between [ and [[ when using bash, so I assume [ is handled (now) by the shell as well.
The syntax inside [[ is different though.
- chasil 2y agoThe dash shell is supposedly four times faster than bash, and dramatically reduced Ubuntu's boot time. The [[ test syntax is not implemented in dash. It is listed as a future reserved word in the POSIX shell standard, but is not (yet?) specified. (Google: POSIX shell) https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V... If you pull the HTML file off the above link, you will get a directory listing of all of the POSIX.2 utilities (tar, sed, awk, etc.). The options that you find in the specifications are maximally portable.