mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2002 (markdown)
@@ -2,11 +2,16 @@
|
||||
|
||||
### Problematic code:
|
||||
|
||||
cat file | tr ' ' _
|
||||
```sh
|
||||
cat file | tr ' ' _ | grep a_
|
||||
```
|
||||
|
||||
### Correct code:
|
||||
|
||||
tr ' ' _ < file
|
||||
```sh
|
||||
tr ' ' _ < file | grep a_
|
||||
< file tr ' ' _ | grep a_ # notice: simple commands only -- won't work with componds
|
||||
```
|
||||
|
||||
### Rationale:
|
||||
|
||||
|
Reference in New Issue
Block a user