fc1.0 revision 211408
1199647Sjilles# $FreeBSD: head/tools/regression/bin/sh/builtins/fc1.0 211408 2010-08-16 22:23:19Z jilles $ 2199647Sjillesset -e 3211408Sjillestrap 'echo Broken pipe -- test failed' PIPE 4199647Sjilles 5199647SjillesP=${TMPDIR:-/tmp} 6199647Sjillescd $P 7199647SjillesT=$(mktemp -d sh-test.XXXXXX) 8199647Sjillescd $T 9199647Sjilles 10199647Sjillesmkfifo input output error 11199955SjillesHISTFILE=/dev/null sh +m -i <input >output 2>error & 12199647Sjilles{ 13199647Sjilles # Syntax error 14199647Sjilles echo ')' >&3 15199647Sjilles # Read error message, shell will read new input now 16199647Sjilles read dummy <&5 17199647Sjilles # Execute bad command again 18199647Sjilles echo 'fc -e true' >&3 19199647Sjilles # Verify that the shell is still running 20199647Sjilles echo 'echo continued' >&3 || rc=3 21199647Sjilles echo 'exit' >&3 || rc=3 22199647Sjilles read line <&4 && [ "$line" = continued ] && : ${rc:=0} 23199647Sjilles} 3>input 4<output 5<error 24199647Sjilles 25199647Sjillesrm input output error 26199647Sjillesrmdir ${P}/${T} 27199647Sjillesexit ${rc:-3} 28