summaryrefslogtreecommitdiff
path: root/corebinutils/sh/tests/parser/ps1-expand5.0
blob: 73fe3ba5a3d58aa1df810ae8e679a24ad200af1a (plain)
1
2
3
4
5
6
7
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