whatis posix
POSIX
Also known as: Portable Operating System Interface
An IEEE standard defining the shell, utilities, and system APIs a Unix-like OS should provide so scripts and programs stay portable.
What Is POSIX in Linux?
POSIX specifies how things like sh, test, find, file permissions, signals, and the C system interface must behave. Linux is not formally certified, but it is POSIX-compatible in practice, which is why software moves easily between Linux, the BSDs, and macOS.
For shell scripting, "POSIX sh" means avoiding bash-only features like arrays and [[ ]]. Scripts that start with #!/bin/sh should stick to POSIX, since on Debian and Ubuntu that path points to dash, not bash.
Example
#!/bin/sh
[ -f "$1" ] && echo "exists" Learn more about POSIX
- Zsh vs Bash vs Fish: Choosing an Interactive Shell Bash is everywhere and scripts run on it. Zsh has the best completion. Fish is the most pleasant out of the box and is not POSIX compatible. Here is what that actually costs.
- Writing Your First Bash Script A practical introduction to Bash scripting: the shebang line, variables, arguments, conditionals, loops, and functions, with runnable examples you can adapt for real automation tasks.