3 ms·
> E044: Use [[ for =~,<,> comparisions Is there any reason to prefer bashisms over POSIX?
by devenblake 5y ago
> E044: Use [[ for =~,<,> comparisions
Is there any reason to prefer bashisms over POSIX?
- yamellasmallela 5y agobecause its 2021 and we should get over compatibility with archaic tech?
- koala_man 5y agoThat is bashate, not ShellCheck, but there is good reason to use [[ since these operators are not POSIX to begin with and don't work in [.
- chasil 5y agoIn Debian/Ubuntu /bin/sh, most certainly.
- hashhar 5y agoBecause the =~ and > and < operators aren't defined for [ in POSIX. Also ShellCheck suggests similar improvement only when your shebang says that bash is the expected interpreter instead of sh (or other ways of denoting POSIX compat).