shellscript_format_check
This script will check if the formatting of the shell script files in the given directory ($PWD
if not given) and its subdirectories adhere to the Google Shell Style.
This script’s exit code is 0
if all shell script files adhere to Google Shell Style or 1
if not.
The following parameters are optional:
v
-
display the paths of the files whose formatting does not adhere to Google Shell Style
Usage
$ scripts/general/shellscript_format_check.sh
$ scripts/general/shellscript_format_check.sh /tmp/example
$ echo $?
1
$ scripts/general/shellscript_format_check.sh -v /tmp/example
/tmp/example/example.sh
$ echo $?
1
$ scripts/general/shellscript_format.sh /tmp/example
$ scripts/general/shellscript_format_check.sh /tmp/example
$ echo $?
0