shfmt

Autoformat shell script source code with consistent style

brewmacoslinux
Try with needOr install directly
Source

About

Autoformat shell script source code

Commands

shfmt

Examples

Format a shell script file in-place$ shfmt -i 2 -w script.sh
Format and display output without modifying the file$ shfmt -i 4 script.sh
Format all shell scripts in a directory recursively$ shfmt -i 2 -w -s $(find . -name '*.sh')