mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
SC3026: alternative correct code to match ^
@@ -11,6 +11,10 @@ echo foo-[^0]*.jpg
|
|||||||
```sh
|
```sh
|
||||||
echo foo-[!0]*.jpg
|
echo foo-[!0]*.jpg
|
||||||
```
|
```
|
||||||
|
or if the intention is to match `^` literally then either do not put it immediately after `[` or quote it by backslash `\`
|
||||||
|
```sh
|
||||||
|
echo foo-[0^]*.jpg foo-[\^0]*.jpg
|
||||||
|
```
|
||||||
|
|
||||||
### Rationale:
|
### Rationale:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user