3 ms·
> You can still see this on macOS bash today: $ str="-e" $ [ \( ! "$str" \) ] bash: [: `)' expected, found ] # bash > POSIX fixes all these ambiguit
by hgsgm 4y ago
> You can still see this on macOS bash today:
$ str="-e"
$ [ \( ! "$str" \) ]
bash: [: `)' expected, found ] # bash
> POSIX fixes all these ambiguities for up to 4 parameters
So... It's not fixed, and the hack is still needed?
- zimpenfish 4y agoTo be fair, that's bash 3.2.57 which was released 2014-11-07. Oldest bash after that I have available is cygwin bash 4.4.12 (2017-10-13) which doesn't have the issue. Just install a newer bash using ports or homebrew and bob is your shell uncle.
- aflag 4y agoIf your script is going to be used by people on macs it’s probably easier to use the hack than ask them to update. Given all she’ll weirdness, I don’t even think this is the most offensive