Member-only story
24 Bashism To Avoid for POSIX-Compliant Shell Scripts
A beginners guide to POSIX with examples

Introduction
The Portable Operating System Interface for Unix (POSIX) is an international standard created by IEEE. By conforming to the POSIX standards, a wide variety of systems including Linux, macOS, and Windows can execute your scripts.
In this article, you will learn about POSIX, its commands, and tips on how to make your Shell scripts more POSIX compliant.
When variant UNIX versions are developed (System V and BSD variants) during the 1980s, shell script portability became difficult. The POSIX standardization was created in 1988. Each OS has a different default system shells as you see in the following table:

Ubuntu’s default login shell remains bash, but a script using the #!/bin/sh
shebang executes as POSIX dash. Dash is smaller in size and faster than Bash.
POSIX describes the contract between the application and the operating system. Following a standardization like POSIX allows your software to run on the largest possible set of UNIX-like environments.