yash hangs when reading dot script without final newline from FIFO
Thanks for reporting, but it does not reproduce on my machine. I tested yash 2.47 on Fedora 27.
$ printf 'echo hi' > fifo & [1] + Running printf 'echo hi' 1>fifo $ ./yash -c '. ./fifo' hi [1] + Done printf 'echo hi' 1>fifo $
Hmm. I'm testing yash 2.47 on Mac OS X 10.11.6 and for me it reproduces consistently. I will test other operating systems and report back.
Thanks for the info. I was able to reproduce on my Mac. It seems the "pselect" function hangs on Mac for no obvious reasons...
FYI, I also cannot reproduce the issue on FreeBSD (yash 2.46), OpenBSD (yash 2.44), or Solaris (yash 2.45). So it does seem to be a Mac-specific bug.
I did some googling, but I have no clue what is happening in the pselect function on Mac. Since FIFOs are expected to be content-neutral, it is quite mysterious that the behavior of pselect depends on existence of a newline in the content transmitted.
I'm closing this bug because I suppose the weird behavior of pselect on Mac is responsible for the hang.
When reading a dot script from a FIFO and that dot script does not end in a newline, yash ignores EOF and hangs waiting for the final newline to arrive. Other shells do not hang on EOF, even if there is no final newline.