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
No-code email and landing page creation Icon
No-code email and landing page creation

Make campaign creation fast and easy with Knak

Built for speed and collaboration, Knak streamlines campaign production with modular templates, real-time editing, simple collaboration, and seamless integrations with leading MAPs like Adobe Marketo Engage, Salesforce Marketing Cloud, Oracle Eloqua, and more. Whether you're supporting global teams or launching fast-turn campaigns, Knak helps you go from brief to build in minutes—not weeks. Say goodbye to bottlenecks and hello to marketing agility.
Learn More
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