]> git.saurik.com Git - apple/shell_cmds.git/blob - sh/tests/builtins/fc1.0
shell_cmds-216.40.4.tar.gz
[apple/shell_cmds.git] / sh / tests / builtins / fc1.0
1 # $FreeBSD: head/bin/sh/tests/builtins/fc1.0 213738 2010-10-12 18:20:38Z obrien $
2 set -e
3 trap 'echo Broken pipe -- test failed' PIPE
4
5 P=${TMPDIR:-/tmp}
6 cd $P
7 T=$(mktemp -d sh-test.XXXXXX)
8 cd $T
9
10 mkfifo input output error
11 HISTFILE=/dev/null ${SH} +m -i <input >output 2>error &
12 {
13 # Syntax error
14 echo ')' >&3
15 # Read error message, shell will read new input now
16 read dummy <&5
17 # Execute bad command again
18 echo 'fc -e true' >&3
19 # Verify that the shell is still running
20 echo 'echo continued' >&3 || rc=3
21 echo 'exit' >&3 || rc=3
22 read line <&4 && [ "$line" = continued ] && : ${rc:=0}
23 } 3>input 4<output 5<error
24
25 rm input output error
26 rmdir ${P}/${T}
27 exit ${rc:-3}