Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Multiple shell versions for testing portable shell scripts (github.com/alganet)
2 points by alganet on July 4, 2024 | hide | past | favorite | 1 comment
shell-versions serves the same niche of nvm or esvu, but for shells.

It is an indispensible tool for anyone who wants to write portable shell scripts.

All shells are built and included in a single 40MB docker image (no manuals, no completions, just the interpreters).

There are two image flavors:

  - latest: contains the two latest versions of each shell.
  - all: contains all shells we can build.
The list of interpreters is:

  - bash: requires no introduction
  - busybox ash: the default busybox shell, other busybox tools not built
  - dash: the de facto shell for scripts
  - ksh93: the fastest most complete bytecode interpreted shell to be abandoned by AT&T
  - mksh / loksh / oksh: different distributions of the BSD port of the public domain ksh88
  - osh: the oil shell, a python-based avant-garde interpreter
  - posh: if you think dash is barebones, you should see this one
  - yash: yet another shell!
  - zsh: the default shell on macos
There are 20+ year versions there of many of these and all recent versions. These should cover many popular and niche use cases.

I'm looking for general feedback and overall portable shell discussion. Thanks!



Good alternatives to bats if you want to write portable test suites that target many shells:

  - https://github.com/shellspec
  - https://github.com/kward/shunit2




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: