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