Re:Shell Script Best Practices, from a decade of scripting t...
by IYasha on Thursday October 27, 2022 @05:46AM
(#33355348)
As much as I love ZSH in my daily life, in sripting I HATE it for not having the "==" operator! >:((
[ Parent
| on HN ]
Re:Shell Script Best Practices, from a decade of scripting t...
by Beltalowda on Thursday October 27, 2022 @07:23AM
(#33355968)
It works inside [[ ]], just not in [ ].
=name will expand to the entry in your PATH. e.g. =ls expands to /usr/bin/ls. So == expands to an executable named =, or rather, it tries to as you probably don't have = in your PATH.
[[ ]] disables expansions (e.g. [[ * = * ]] will work too) so it's not an issue there.