A shell parser, formatter, and interpreter. Supports POSIX Shell, Bash, and mksh. Requires Go 1.16 or later. To parse shell scripts, inspect them, and print them out, see the syntax examples. For high-level operations like performing shell expansions on strings, see the shell examples. shfmt formats shell programs. See canonical.sh for a quick look at its default style. shfmt formats shell programs. If the only argument is a dash (-) or no arguments are given, standard input will be used. If a given path is a directory, all shell scripts found under that directory will be used. When indexing Bash associative arrays, always use quotes. The static parser will otherwise have to assume that the index is an arithmetic expression. Some builtins like export and let are parsed as keywords. A subset of the Go packages are available as an npm package called mvdan-sh.

Features

  • Parse shell scripts
  • High-level operations like performing shell expansions
  • shfmt formats shell programs
  • Packages are available on Alpine, Arch, Debian, Docker, FreeBSD, etc.
  • We use Go's native fuzzing support
  • Requires Go 1.18 or later
  • Some builtins like export and let are parsed as keywords

Project Samples

Project Activity

See All Activity >

License

BSD License

Follow sh

sh Web Site

Other Useful Business Software
Zenflow- The AI Workflow Engine for Software Devs Icon
Zenflow- The AI Workflow Engine for Software Devs

Parallel agents. Multi-agent orchestration. Specs that turn into shipped code. Zenflow automates planning, coding, testing, and verification.

Zenflow is the AI workflow engine built for real teams. Parallel agents plan, code, test, and verify in one workflow. With spec-driven development and deep context, Zenflow turns requirements into production-ready output so teams ship faster and stay in flow.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of sh!

Additional Project Details

Programming Language

Go

Related Categories

Go Terminals, Go User Interface (UI) Software

Registered

2022-04-11