shellscript_format

This script will format the shell script files in the given directory ($PWD if not given) and its subdirectories according to Google Shell Style.

Usage

$ scripts/general/shellscript_format.sh
$ scripts/general/shellscript_format.sh /tmp/example

Instead of this script you might want to add a shell alias:

alias shfmtg='shfmt --write --indent 2 --case-indent --binary-next-line --simplify'

$ shfmtg .
$ shfmtg /tmp/example

Prerequisites

More Information