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