-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC3026
Vidar Holen edited this page Sep 8, 2020
·
9 revisions
echo foo-[^0]*.jpg
echo foo-[!0]*.jpg
[^c]
is frequently used in most regular expression variants to mean "any character except c
". This is so pervasive that bash, ksh, dash, and BusyBox ash, all allow it.
However, strictly speaking, the only range complement syntax guaranteed to be supported across shells is [!c]
.
If you only intend to target shells that supports this feature, you can change the shebang to a shell that guarantees support, or ignore this warning. Or just rewrite it to be on the technically correct side.
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!