mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2164 (markdown)
11
SC2164.md
11
SC2164.md
@@ -5,6 +5,11 @@
|
||||
```sh
|
||||
cd generated_files
|
||||
rm -r *.c
|
||||
|
||||
func(){
|
||||
cd foo
|
||||
do_something
|
||||
}
|
||||
```
|
||||
|
||||
### Correct code:
|
||||
@@ -12,6 +17,12 @@ rm -r *.c
|
||||
```sh
|
||||
cd generated_files || exit
|
||||
rm -r *.c
|
||||
|
||||
# For functions, you may want to use return:
|
||||
func(){
|
||||
cd foo || return
|
||||
do_something
|
||||
}
|
||||
```
|
||||
|
||||
### Rationale:
|
||||
|
Reference in New Issue
Block a user