shell-scripts
Installation
SKILL.md
Shell Scripts
Apply these rules whenever writing or reviewing shell script files.
Default target: maximum portability — scripts must work on GNU/Linux, BSDs (FreeBSD, OpenBSD, NetBSD), macOS, and BusyBox/Alpine without modification, unless the user explicitly restricts the target platform.
Cross-Platform Portability
Scripts must work on all of these without modification unless a target is explicitly narrowed:
| Platform | Shell | Notes |
|---|---|---|
| GNU/Linux (glibc) | dash or bash as sh |
GNU coreutils; date, sed, awk are GNU-flavored |
| Alpine / BusyBox | ash | Minimal builtins; no GNU extensions |
| macOS | bash 3.2 or zsh as sh |
BSD coreutils; sed, date, stat differ from GNU |
| FreeBSD / OpenBSD / NetBSD | sh (pdksh/ash variant) | BSD coreutils; POSIX-strict |