mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Speling nasi fixed some typos.
@@ -1,6 +1,6 @@
|
|||||||
By default, `shellcheck` does not support a `-r` option. The reason for this, is that there are different matching patterns for different files.
|
By default, `shellcheck` does not support a `-r` option. The reason for this, is that there are different matching patterns for different files.
|
||||||
|
|
||||||
Script could have a `.sh` extension, no extension and have a range of shebang lines (which have there own testing format):
|
Script could have a `.sh` extension, no extension and have a range of shebang lines (which have their own testing format):
|
||||||
|
|
||||||
* `#!/bin/bash`
|
* `#!/bin/bash`
|
||||||
* `#!/bin/sh`
|
* `#!/bin/sh`
|
||||||
@@ -38,7 +38,7 @@ for file in $(find path/to/scripts -type f -name "*.sh"); do shellcheck --format
|
|||||||
|
|
||||||
## Finding files to test
|
## Finding files to test
|
||||||
|
|
||||||
Since not all script have a `.sh` extension, you could use the shebang line of files to determine if they need to be testen (and with which format):
|
Since not all scripts have a `.sh` extension, you could use the shebang line of files to determine if they need to be tested (and with which format):
|
||||||
|
|
||||||
```
|
```
|
||||||
for file in $(grep -IRl "#\!\(/usr/bin/env \|/bin/\)sh" --exclude-dir "var" --exclude "*.txt"); do shellcheck --format=gcc --shell=sh $file; done;
|
for file in $(grep -IRl "#\!\(/usr/bin/env \|/bin/\)sh" --exclude-dir "var" --exclude "*.txt"); do shellcheck --format=gcc --shell=sh $file; done;
|
||||||
|
Reference in New Issue
Block a user