aboutsummaryrefslogtreecommitdiff
path: root/bin/sh/tests/parser/ps1-expand4.0
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sh/tests/parser/ps1-expand4.0')
-rw-r--r--bin/sh/tests/parser/ps1-expand4.08
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/sh/tests/parser/ps1-expand4.0 b/bin/sh/tests/parser/ps1-expand4.0
new file mode 100644
index 000000000000..623c52707eec
--- /dev/null
+++ b/bin/sh/tests/parser/ps1-expand4.0
@@ -0,0 +1,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