rush / docs
Rush aims to be useful to people who already know Bash, while also providing a POSIX mode for scripts that want POSIX-facing behavior. This page records known, intentional, or currently accepted compatibility differences when another shell's behavior is a common reference point.
These notes are not a complete compatibility matrix. They are for cases where Rush makes a deliberate choice, where common system shells disagree, or where an older Bash version behaves differently from current Bash.
Rush treats an attempt to assign a default value to a positional parameter with ${parameter:=word} as a fatal expansion error when the assignment would be required.
set -- '' printf '%s\n' ${1:=fallback} printf 'after\n'
POSIX parameter assignment through := assigns only shell variables; positional parameters cannot be assigned this way. Rush reports the error and does not print after. This matches dash, ksh93, and yash. Bash 3.2 and Bash 5.3 in POSIX mode report the error but continue executing the script. zsh 5.9 in sh emulation assigns the positional parameter and continues.
Rush treats a variable whose contents are not a valid integer constant as an arithmetic expansion error when the variable is used as an arithmetic operand.
x=abc printf '%s\n' "$((x))" printf 'after\n'
POSIX requires arithmetic expansion to fail with a diagnostic when the contents of a shell variable used in the expression are not recognized by the shell. Rush reports the error and does not print after. This matches dash and ksh93. Bash 3.2 and Bash 5.3 in POSIX mode instead expand this case to 0 and continue executing the script.
macOS still ships Bash 3.2 as /bin/bash. Rush does not treat Bash 3.2 behavior as the sole Bash compatibility target when newer Bash versions and POSIX-mode shells agree on different behavior.
In non-interactive POSIX mode, Rush treats an attempt to unset a readonly variable as a fatal error for the current shell execution environment.
readonly ro=value unset ro printf 'after\n'
Rush reports the error and does not print after. This matches dash and modern Bash POSIX mode. Bash 3.2 POSIX mode reports the error but continues executing the script.