xref: /freebsd/bin/sh/tests/parser/ps2-expand1.0 (revision f9e79facf874567f25147b24863e5198164e8d04)
1*f9e79facSMatthew Phillips# Test variable expansion in PS2 (continuation prompt)
2*f9e79facSMatthew Phillipstestvar=continue
3*f9e79facSMatthew Phillips# Send incomplete command (backslash at end) to trigger PS2
4*f9e79facSMatthew Phillipsoutput=$(testvar=continue PS2='$testvar>' ENV=/dev/null ${SH} +m -i <<EOF 2>&1
5*f9e79facSMatthew Phillipsecho \\
6*f9e79facSMatthew Phillipsdone
7*f9e79facSMatthew PhillipsEOF
8*f9e79facSMatthew Phillips)
9*f9e79facSMatthew Phillipscase $output in
10*f9e79facSMatthew Phillips*continue\>*) exit 0 ;;
11*f9e79facSMatthew Phillips*) echo "Expected 'continue>' in PS2 output"; exit 1 ;;
12*f9e79facSMatthew Phillipsesac
13