mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 11:19:45 +08:00
Updated SC2203 (markdown)
10
SC2203.md
10
SC2203.md
@@ -28,12 +28,4 @@ Instead, you can iterate over the filenames you want with a loop, and apply your
|
||||
|
||||
### Exceptions:
|
||||
|
||||
If you know your glob will only ever match one file, you can check this explicitly and use the first file:
|
||||
|
||||
```
|
||||
set -- backup/*.log
|
||||
[[ $# -eq 1 ]] || { echo "There are too many matches."; exit 1; }
|
||||
[[ file.log -nt "$1" ]] && echo "This is the latest file"
|
||||
```
|
||||
|
||||
Alternatively, [[ignore]] this warning.
|
||||
None.
|
Reference in New Issue
Block a user