summaryrefslogtreecommitdiff
path: root/corebinutils/sh/tests/parser/ps1-expand3.0
blob: 0b6270c300ff0c717c19af47ff07e56f03221e0d (plain)
1
2
3
4
5
6
7
8
# Test special parameter $$ (PID) in PS1
output=$(PS1='pid:$$:' ENV=/dev/null ${SH} +m -i </dev/null 2>&1)
# Check that output contains "pid:" followed by a number (not literal $$)
case $output in
*pid:\$\$:*) echo "PID not expanded, got literal \$\$"; exit 1 ;;
*pid:[0-9]*) exit 0 ;;
*) echo "Expected PID after 'pid:' in output"; exit 1 ;;
esac