mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2011 (markdown)
@@ -3,17 +3,17 @@
|
||||
### Problematic code:
|
||||
|
||||
```sh
|
||||
ls | xargs wc -w
|
||||
ls | xargs -n1 wc -w
|
||||
```
|
||||
|
||||
### Correct code:
|
||||
|
||||
```sh
|
||||
find . -maxdepth 1 -print0 | xargs -0 wc -w
|
||||
find . -maxdepth 1 -print0 | xargs -0 -n1 wc -w
|
||||
```
|
||||
|
||||
```sh
|
||||
find . -maxdepth 1 -print0 -exec wc -w
|
||||
find . -maxdepth 1 -type f -exec wc -w {} \;
|
||||
```
|
||||
|
||||
### Rationale:
|
||||
|
Reference in New Issue
Block a user