summaryrefslogtreecommitdiff
path: root/corebinutils/sh/tests/parser/ps1-expand4.0
blob: 623c52707eec283ecaa8c6004c87e75b6fc61951 (plain)
1
2
3
4
5
6
7
8
# Test special parameter $? (exit status) in PS1
output=$(PS1='status:$?:' ENV=/dev/null ${SH} +m -i </dev/null 2>&1)
# Should start with exit status 0
case $output in
*status:\$?:*) echo "Exit status not expanded, got literal \$?"; exit 1 ;;
*status:0:*) exit 0 ;;
*) echo "Expected 'status:0:' in initial prompt"; exit 1 ;;
esac