Lars Ellenberg <[EMAIL PROTECTED]> wrote: > it may be that the "original" version was done this way to increase the > likelihood for the whole message to get to the fifo as _one_ blob, > relying on the internal buffering of the first of the 'cat's. > > doing "echo >> $HA_FIFO; cat >> $FIFO; echo >> $HA_FIFO", the fifo > would be open/write/fflush/close by bash/sh/the commands three times. > > doing (echo ; cat ; echo ) >> $FIFO, bash/sh should only open/close it > once, but each of the commands would imply a dup/write/fflush/close, > all making it more likely that concurrent users of that function would > garble each others messages. > > but thats just me guessing after doing shell magic since quite a while > with lots of different versions of different shells...
Concurrency is probably very nasty here regardless. But I agree that either (echo ">>>"; cat -; echo "<<<") >> $HA_FIFO or your version with cat - at the end is a bit nicer with respect to this. than the 3 x >> approach. Though personally I think the extra cat - is clutching at straws. -- Horms H: http://www.vergenet.net/~horms/ W: http://www.valinux.co.jp/en/ _______________________________________________________ Linux-HA-Dev: [email protected] http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/
