Fix caps and highlight (broken) code-sample

John Gardner
2021-12-22 16:10:16 +11:00
parent 6fe6cfcdb7
commit b41ead76cc

@@ -4,15 +4,17 @@ When ShellCheck is unable to parse a file, it'll output several errors to help p
Consider this script, with a missing double quote on line 1: Consider this script, with a missing double quote on line 1:
```sh
ssh host "$cmd ssh host "$cmd
echo "Finished" echo "Finished"
```
Bash says: Bash says:
file: line 2: unexpected EOF while looking for matching `"' file: line 2: unexpected EOF while looking for matching `"'
file: line 3: syntax error: unexpected end of file file: line 3: syntax error: unexpected end of file
Shellcheck says: ShellCheck says:
In file line 1: In file line 1:
ssh host "$cmd ssh host "$cmd
@@ -29,6 +31,6 @@ Shellcheck says:
1. One info showing the outer construct being parsed (SC1009) 1. One info showing the outer construct being parsed (SC1009)
1. Potentially some specific suggestions, such as when missing an `fi`. 1. Potentially some specific suggestions, such as when missing an `fi`.
Here, shellcheck says that the command on line 1 is faulty, which makes it easier to find and fix the actual problem. Here, ShellCheck says that the command on line 1 is faulty, which makes it easier to find and fix the actual problem.
Most of ShellCheck's functionality (specifically, any checks with code >= SC2000) only applies to scripts that parse successfully, so make sure to rerun ShellCheck after fixing any syntax errors. Most of ShellCheck's functionality (specifically, any checks with code >= SC2000) only applies to scripts that parse successfully, so make sure to rerun ShellCheck after fixing any syntax errors.