A POSIX Playground Container for Shell Script Testing
After exploring portable scripting in the previous article, I built a container available on Docker Hub, useful for testing and experimentation.
After exploring portable scripting in the previous article, I built a container available on Docker Hub, useful for testing and experimentation.
Shells like Bash or Zsh are advanced and user-friendly, and include features beyond what a simpler POSIX-compliant shell might offer. You will do well to utilize the full features of your shell when writing scripts.
There are situations, however, when portability should be a valued feature, allowing the script to run on a variety of shells.
Have you ever wanted to execute one command if another failed? Or one command only if the first one succeeded? What about background execution?
Bash and other popular shells such as Zsh and Ash/Dash have some useful but sometimes confusing operators for command execution.