aboutsummaryrefslogtreecommitdiff
path: root/bin/sh/tests/parser/ps1-expand5.0
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sh/tests/parser/ps1-expand5.0')
-rw-r--r--bin/sh/tests/parser/ps1-expand5.08
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/sh/tests/parser/ps1-expand5.0 b/bin/sh/tests/parser/ps1-expand5.0
new file mode 100644
index 000000000000..73fe3ba5a3d5
--- /dev/null
+++ b/bin/sh/tests/parser/ps1-expand5.0
@@ -0,0 +1,8 @@
+# Test positional parameter $0 in PS1
+output=$(PS1='shell:$0:' ENV=/dev/null ${SH} +m -i </dev/null 2>&1)
+# $0 should contain the shell name/path
+case $output in
+*shell:\$0:*) echo "Positional parameter not expanded, got literal \$0"; exit 1 ;;
+*shell:*sh*:*) exit 0 ;;
+*) echo "Expected shell name after 'shell:' in output"; exit 1 ;;
+esac