[Linux-ha-dev] Re: Question about heartbeat/shellfuncs
Horms
horms at verge.net.au
Wed Aug 9 05:22:45 MDT 2006
David Lee <t.d.lee at durham.ac.uk> 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.
--
Horms
H: http://www.vergenet.net/~horms/
W: http://www.valinux.co.jp/en/
More information about the Linux-HA-Dev
mailing list