local x=1; f(){ local x; echo "[$x]"; }; f DASH: [1]|<0>| BASH: []|<0>|
dots mkdir -p d/.h && cd d && echo .* DASH: . .. .h|<0>| BASH: .h|<0>|
atjoin set -- a b; IFS=:; x=$@; echo "$x" DASH: a:b|<0>| BASH: a b|<0>|
atpat set -- ab cb; echo "${@#?}" "${*%b}" DASH: b cb ab c|<0>| BASH: b b a c|<0>|
atlen set -- a b; echo ${#@} ${#*} DASH: 3 3|<0>| BASH: 2 2|<0>|
bqdq echo "${x:-`echo \"q\"`}" DASH: q|<0>| BASH: "q"|<0>|
return echo a; return; echo b DASH: a|<0>| BASH: a|bash: line 1: return: can only `return' from a function or sourced script|<2>|
unsetloc x=g; f() { local x=1; g; echo "f:[$x]"; }; g() { unset x; echo "g:[$x]"; }; f DASH: g:[]|f:[]|<0>| BASH: g:[g]|f:[g]|<0>|
dashvar echo "[$-]" DASH: []|<0>| BASH: [hBc]|<0>|
lineno echo "[$LINENO]" DASH: []|<0>| BASH: [1]|<0>|
setx set -x; echo "a b" DASH: + echo a b|a b|<0>| BASH: + echo 'a b'|a b|<0>|
setv set -v; echo a DASH: a|<0>| BASH: a|<0>|
listset f() { :; }; set | grep -c '^f' DASH: 0|<1>| BASH: 0|<1>|
listtrap trap 'echo t' INT; trap DASH: trap -- 'echo t' INT|<0>| BASH: trap -- 'echo t' INT|trap -- '' TSTP|<0>|
exportp export ZZ=1; export -p | grep ZZ DASH: export ZZ='1'|<0>| BASH: export ZZ="1"|<0>|
typecmd type ls DASH: ls is /usr/bin/ls|<0>| BASH: ls is /usr/bin/ls|<0>|
commandV command -V ls DASH: ls is /usr/bin/ls|<0>| BASH: ls is /usr/bin/ls|<0>|
fdmulti echo hi 10>/dev/null DASH: <0>| BASH: hi|<0>|
redirdigit echo x >&2>f; cat f DASH: dash: 1: Syntax error: redirection unexpected|<2>| BASH: x|<0>|
dupfile echo hi >&f; cat f DASH: dash: 1: Syntax error: Bad fd number|<2>| BASH: hi|<0>|
caret case b in [^a]) echo neg;; *) echo lit;; esac DASH: lit|<0>| BASH: neg|<0>|
uidset UID=5 echo hi DASH: hi|<0>| BASH: bash: line 1: UID: readonly variable|<1>|
tildehome unset HOME; echo ~ DASH: ~|<0>| BASH: /root|<0>|
ps1 echo "[$PS1]" DASH: [# ]|<0>| BASH: []|<0>|
fnlocal local() { echo f; }; local DASH: dash: 1: Syntax error: Bad function name|<2>| BASH: f|<0>|
fnsource source() { echo f; }; source DASH: f|<0>| BASH: bash: line 1: `source': is a special builtin|<2>|
job sleep 1 & kill %1; echo $? DASH: dash: 1: kill: No such process||1|<0>| BASH: 0|<0>|
pipefail set -o pipefail; false | true; echo $? DASH: dash: 1: set: Illegal option -o pipefail|<2>| BASH: 1|<0>|
dbracket [[ a == a* ]] && echo y DASH: dash: 1: [[: not found|<127>| BASH: y|<0>|
dparen ((x=1+1)); echo $x DASH: |<0>| BASH: 2|<0>|
dollarbr echo $[1+2] DASH: $[1+2]|<0>| BASH: 3|<0>|
incr i=1; echo $((i++)) $i DASH: dash: 1: arithmetic expression: expecting primary: "i++"|<2>| BASH: 1 2|<0>|
comma echo $((1, 2)) DASH: dash: 1: arithmetic expression: expecting EOF: "1, 2"|<2>| BASH: 2|<0>|
ansi echo $'a\tb' DASH: $a b|<0>| BASH: a b|<0>|
locale echo $"hi" DASH: $hi|<0>| BASH: hi|<0>|
array a=(x y); echo ${a[1]} DASH: dash: 1: Syntax error: "(" unexpected|<2>| BASH: y|<0>|
substr x=abcd; echo ${x/b/X} ${x:1:2} ${x^^} DASH: dash: 1: Bad substitution|<2>| BASH: aXcd bc ABCD|<0>|
indirect y=z; x=y; echo ${!x} DASH: dash: 1: Bad substitution|<2>| BASH: z|<0>|
procsub cat <(echo hi) DASH: dash: 1: Syntax error: "(" unexpected|<2>| BASH: hi|<0>|
herestr cat <<< hi DASH: dash: 1: Syntax error: redirection unexpected|<2>| BASH: hi|<0>|
ampgt echo hi &>/dev/null; echo st=$? DASH: st=0|hi|<0>| BASH: st=0|<0>|
pipeamp echo hi |& cat DASH: dash: 1: Syntax error: "&" unexpected|<2>| BASH: hi|<0>|
brace echo a{b,c} {1..3} DASH: a{b,c} {1..3}|<0>| BASH: ab ac 1 2 3|<0>|
function function f { echo f; }; f DASH: dash: 1: Syntax error: "}" unexpected|<2>| BASH: f|<0>|
source echo 'echo sourced' >s.sh; source ./s.sh DASH: dash: 1: source: not found|<127>| BASH: sourced|<0>|
declare declare -i n=1+2; echo $n DASH: dash: 1: declare: not found||<0>| BASH: 3|<0>|
let let n=2+3; echo $n DASH: dash: 1: let: not found||<0>| BASH: 5|<0>|
pushd pushd /tmp >/dev/null && popd >/dev/null && echo ok DASH: dash: 1: pushd: not found|<127>| BASH: ok|<0>|
shopt shopt -s nullglob; echo ok DASH: dash: 1: shopt: not found|ok|<0>| BASH: ok|<0>|
readp echo x | { read -p 'p: ' v; echo "[$v]"; } DASH: [x]|<0>| BASH: [x]|<0>|
readd printf 'a:b' | { read -d : v; echo "[$v]"; } DASH: dash: 1: read: Illegal option -d|[]|<0>| BASH: [a]|<0>|
random echo ${RANDOM:+set} DASH: |<0>| BASH: set|<0>|
pipestatus false | true; echo "${PIPESTATUS[0]}" DASH: dash: 1: Bad substitution|<2>| BASH: 1|<0>|
select select x in a; do break; done </dev/null; echo ok DASH: dash: 1: Syntax error: "do" unexpected|<2>| BASH: 1) a|#? |ok|<0>|
extglob echo @(a|b) DASH: dash: 1: Syntax error: "(" unexpected|<2>| BASH: bash: -c: line 1: syntax error near unexpected token `('|bash: -c: line 1: `echo @(a|b)'|<2>|
coproc coproc cat; echo ok DASH: dash: 1: coproc: not found|ok|<0>| BASH: ok|<0>|
time time true 2>/dev/null; echo ok DASH: ok|<0>| BASH: |real 0m0.000s|user 0m0.000s|sys 0m0.000s|ok|<0>|
shiftover shift 3; echo after DASH: dash: 1: shift: can't shift that many|<2>| BASH: bash: line 1: shift: 3: shift count out of range|after|<0>|
exportbad n=1x; export "$n=2"; echo after DASH: dash: 1: export: 1x: bad variable name|<2>| BASH: bash: line 1: export: `1x=2': not a valid identifier|after|<0>|
qmark echo ${zz:?unset}; echo after DASH: dash: 1: zz: unset|<2>| BASH: bash: line 1: zz: unset|<127>|
cmdvst command -v nosuch; echo $? DASH: 127|<0>| BASH: 1|<0>|
getoptsend getopts ab: o -b v; getopts ab: o -b v; echo "[$o] [$OPTARG] $OPTIND" DASH: [?] [v] 3|<0>| BASH: [?] [] 3|<0>|
cdhome unset HOME; cd; echo $? DASH: 0|<0>| BASH: bash: line 1: cd: HOME not set|1|<0>|
readonlyas readonly r=1; r=2; echo after DASH: dash: 1: r: is read only|<2>| BASH: bash: line 1: r: readonly variable|<127>|