logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Format Shell Script - shfmt Formatter | Online Free DevTools by Hexmos

Format shell scripts easily with shfmt. Enhance code readability and enforce consistent style using this powerful shell parser and formatter. Free online tool, no registration required.

shfmt

Shell parser, formatter and interpreter. More information: https://pkg.go.dev/mvdan.cc/sh.

  • Print a formatted version of a shell script:

shfmt {{path/to/file}}

  • List unformatted files:

shfmt --list {{path/to/directory}}

  • Write the result to the file instead of printing it to the terminal:

shfmt --write {{path/to/file}}

  • Simplify the code, removing redundant pieces of syntax (i.e. removing “$” from vars in expressions):

shfmt --simplify {{path/to/file}}

See Also