On 6/11/10 5:10 PM, Kevin wrote: > Maybe I'm doing something wrong, but the following will make bash > crash. > > > terminal 2: > $ mkfifo test > $ while true; do echo foo && sleep 1; done > test > > terminal 1: > $ <test cat > > wait for a few "foo"s to be printed and then kill with ctrl-c > terminal 2 will read: > > Warning: Program '/bin/bash' crashed.
Bash gets a SIGPIPE and exits, since that's a fatal signal. The question is whether it should try and figure out whether the file it's writing to is a pipe and catch and discard SIGPIPE if so. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/