I can imagine that someone would find a program like this to be useful, and depends on the presently common behavior of zcat, so I expect this is an important part of a system used by a corporation I interact with (and probably many more than I’d expect):
if
zcat ./file.txt.gz >/dev/null
then
process_file ./file.txt.gz
elseprintf'%s\n'"There was a decimal exit status of ${?}"fi
Well in this particular case, zcat failing with error on uncompressed text isn’t a behaviour worth preserving.
It should do the expected zcat behaviour, which is just print the text.
I have a hard time imagining a scenario where you call zcat and would prefer an error rather than a useable output
I already expressed that quickly getting an exit status that isn’t 0 after an issue is encountered is probably useful.
I can imagine that someone would find a program like this to be useful, and depends on the presently common behavior of
zcat
, so I expect this is an important part of a system used by a corporation I interact with (and probably many more than I’d expect):if zcat ./file.txt.gz >/dev/null then process_file ./file.txt.gz else printf '%s\n' "There was a decimal exit status of ${?}" fi
A failure to understand whether something is useful is not a good reason to change it.