On 8/9/06, Horms <[EMAIL PROTECTED]> wrote:
David Lee <[EMAIL PROTECTED]> wrote:
> If all the above is correct, wouldn't the function be clearer as:
>
>   # copy stdin (text) to FIFO, with surrounding ">>>" and "<<<" marker lines.
>   # no args.; no result
>   ha_clustermsg() {
>        echo ">>>" >> $HA_FIFO
>        cat - >> $HA_FIFO
>        echo "<<<" >> $HA_FIFO
>   }
>
> or:
>   # copy stdin (text) to FIFO, with surrounding ">>>" and "<<<" marker lines.
>   # no args.; no result
>   ha_clustermsg() {
>        (echo ">>>"; cat -; echo "<<<") >> $HA_FIFO
>   }
>
> or similar?
>
> (Note that the "cat -" could be reduced to "cat".  But for clarity I
> prefer the "cat -" version, which makes explicit to the maintainers the
> intention to use stdin as the data source.  Clarity again.)
>
> Matt; LMB; others: thoughts?

Any variation on that theme is fine by me.
Any time I see `...` inside a here-doc I start to become squeamish.

Actually, for what its worth, I prefer the first version,
it seems clear, and newlines are not a scarce resource.

agreed
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to