Comment

Comment by js2

Both `[` and `test` are built-ins (they are the same command). There's nothing in-efficient about using them. You might always use `[[` for consistency, but I personally use `if test` unless I need the functionality of `[[` since I find `if test` more legible and when I see `[[` it's a hint that, yes, I really do need its functionality.

https://www.gnu.org/software/bash/manual/html_node/Bourne-Sh...

All of recommendations about efficiency seem misguided to me.

parent js2 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton