On 8/20/21 7:52 AM, Krzysztof Żelechowski wrote:
echo hello >a
ln a b
gzip -k b && gzip -cd b.gz >>b
This would trash 'a' if gzip -k succeeded. (Same with 'ln -s'.)
The appending redirection operator has nothing to do with gzip.
That's true even without -k: if plain 'gzip b' succeeded in this case,
any problem that the user ran into later would have nothing to do with
gzip. Plain 'gzip b' ignores 'b' here, not because compressing 'b' would
cause any problem with gzip itself, but because it could cause confusion
*later*.
My normal usage of (hard) links is as follows:
Create a file page.txt. Link it to page.html.
Want to view? Open page.html.
Want to edit? Open page.txt.
Want to attach? gzip -k page.html … oops.
Oh my. That is ... unusual. Let's see if others chime in about whether
this usage would justify changing the behavior of gzip -k.