diff --git a/pages/common/shfmt.md b/pages/common/shfmt.md new file mode 100644 index 0000000000..60edf675e0 --- /dev/null +++ b/pages/common/shfmt.md @@ -0,0 +1,20 @@ +# shfmt + +> Shell parser, formatter and interpreter. +> More information: . + +- 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}}`