System Grab Bag

View all TLDR pages from common (or from all pages)

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}}

License and Disclaimer

The content on this page is copyright © 2014—present the tldr-pages team and contributors.
This page is used with permission under Creative Commons Attribution 4.0 International License.

While we do attempt to make sure content is accurate, there isn't a warranty of any kind.