mvdan/sh
View on GitHub ↗ ★ 9,172 Go
A shell parser, formatter, and interpreter with bash and zsh support; includes shfmt
30 mentions on Hacker News by 20 people: 12 stories, 18 comments · first 2016-06-04 · latest 2025-04-09
20082026
-
…only backslashes. If you use `&&` -- you have disambiguated the two cases so I can format it. [1] https://github.com/mvdan/sh
comment by spicypete · 2025-04-09 · in Dockerfmt: A Dockerfile Formatter -
…inconsistencies can be autofixed with shfmt. I've been using it for years and it's been solid. https://github.com/mvdan/sh
comment by 5e92cb50239222b · 2024-05-22 · in Amber: Programming language compiled to Bash -
…run this on my scripts before using them. Then shfmt for nice, reliable autoformatting: https://github.com/mvdan/sh And finally, checkbashisms if you intend on making pure posix scripts that are compatible with debian/ubuntu's dash. It is…
comment by ftaghn · 2023-08-09 · in Pure Bash Bible (2018) -
https://github.com/mvdan/sh/blob/master/syntax/canonical.sh is one small example.
comment by mvdan · 2023-02-11 · in Shfmt – format shell programs -
…properly would be quite a bit of work, and such ambiguous syntax isn't particularly common. See https://github.com/mvdan/sh/issues/686 for my current thoughts on how to tackle it. The third caveat concerns parsing `export` and `let` as…
comment by mvdan · 2023-02-11 · in Shfmt – format shell programs -
…(9 comments) shmfmt - A shell parser, formatter, and interpreter with BASH support https://github.com/mvdan/sh (Submitted often but not yet discussed) --- /me whispers: Hint: You could be that guy [1] (or gal, they, it, etc): /submit shmfmt
comment by metadat · 2023-02-11 · in Gofumpt: A stricter gofmt -
…not found an optimal way to do it yet. [shellcheck] https://github.com/koalaman/shellcheck [shfmt] https://github.com/mvdan/sh [sub] https://github.com/qrush/sub [bashdb] http://bashdb.sourceforge.net/ [vscode-bash-debug]…
comment by bfm · 2022-05-03 · in Bash-oneliner: A collection of handy Bash one-liners and terminal tricks -
…example: https://github.com/u-root/u-root/tree/master/cmds/core EDIT: You may also be interested in https://github.com/mvdan/sh
comment by andreynering · 2021-12-06 · in Uutils: an attempt at writing cross-platform CLI utilities in Rust -
The shfmt parser seems re-usable: https://github.com/mvdan/sh (syntax subpackage).
comment by arp242 · 2021-10-20 · in s/bash/zsh/g -
…for ShellCheck compliance: https://github.com/anordal/shellharden/ shfmt is gofmt for shell: https://github.com/mvdan/sh ShellScriptFormatter is another formatter: https://github.com/osalvador/ShellScriptFormatter Some of these tools and…
comment by pabs3 · 2021-05-03 · in ShellCheck: Finds bugs in your shell scripts -
…This is built on tree-sitter, but there are a couple of other interesting shell parser projects: * https://github.com/mvdan/sh * https://github.com/koalaman/shellcheck At Fig ( https://withfig.com ), we had to write a bash parser from…
comment by brendanfalk · 2021-04-01 · in Bash-LSP: A language server for Bash -
…for ShellCheck compliance: https://github.com/anordal/shellharden/ shfmt is gofmt for shell: https://github.com/mvdan/sh ShellScriptFormatter is another formatter: https://github.com/osalvador/ShellScriptFormatter Some of these tools and…
comment by pabs3 · 2021-03-19 · in ShellCheck: A static analysis tool for shell scripts -
To use in combination with shfmt : https://github.com/mvdan/sh
comment by hivacruz · 2021-03-18 · in ShellCheck: A static analysis tool for shell scripts -
…is one of my favorite tips for almost effortlessly improving devops productivity (along with using https://github.com/mvdan/sh for auto-formatting) — by now shellcheck has good editor support in e.g. VSCode and I have a standard…
comment by acdha · 2021-03-18 · in ShellCheck: A static analysis tool for shell scripts -
I would also add shfmt, to format scripts: https://github.com/mvdan/sh
comment by hivacruz · 2020-10-10 · in Bash Error Handling -
…both ShellCheck and shfmt had really helped me to save time and write safer, readable scripts. https://github.com/mvdan/sh
comment by sirtoffski · 2020-02-02 · in Writing Safe Shell Scripts (2019) -
is https://github.com/mvdan/sh relevant ?
comment by pyed · 2016-06-04 · in Shell Style Guide from Google