mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2034 (markdown)
11
SC2034.md
11
SC2034.md
@@ -53,10 +53,17 @@ read _ last _ zip _ _ <<< "$str"
|
|||||||
echo "$last, $zip"
|
echo "$last, $zip"
|
||||||
```
|
```
|
||||||
|
|
||||||
or if you prefer to keep the names, use a directive to disable the warning:
|
Or optionally as a prefix for dummy variables (ShellCheck >0.7.2).
|
||||||
|
|
||||||
|
```
|
||||||
|
read _first last _email zip _lat _lng <<< "$str"
|
||||||
|
echo "$last, $zip"
|
||||||
|
```
|
||||||
|
|
||||||
|
For versions <= 0.7.2, the message can optionally be [[ignore]]d with a directive:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# shellcheck disable=SC2034 # Unused variables left for readability
|
# shellcheck disable=SC2034 # Unused variables left for readability
|
||||||
read first last email zip lat lng <<< "$str"
|
read first last email zip lat lng <<< "$str"
|
||||||
echo "$last, $zip"
|
echo "$last, $zip"
|
||||||
```
|
``
|
Reference in New Issue
Block a user