interdimensionalmeme@lemmy.ml to Linux@lemmy.ml · 15 hours agozcat shouldn't error out if you try to zcat an uncompressed file, it should just output the damned file !message-squaremessage-square15fedilinkarrow-up162arrow-down16file-text
arrow-up156arrow-down1message-squarezcat shouldn't error out if you try to zcat an uncompressed file, it should just output the damned file !interdimensionalmeme@lemmy.ml to Linux@lemmy.ml · 15 hours agomessage-square15fedilinkfile-text
minus-squareinterdimensionalmeme@lemmy.mlOPlinkfedilinkarrow-up6arrow-down1·edit-215 hours agoThanks ! But still we shouldn’t have to resort to this ! Also, can’t get the output through pipe for i in $(ls); do zcat $i || cat $i; done | grep mysearchterm this appears to work find . -type f -print0 | xargs -0 -I{} sh -c 'zcat "{}" 2>/dev/null || cat "{}"' | grep "mysearchterm" Still, that was a speed bump that I guess everyone dealing with mass compressed log files has to figure out on the fly because zcat can’t read uncompressed files ! argg !!! for i in $(ls); do zcat $i 2>/dev/null || cat $i; done | grep mysearchterm
Thanks !
But still we shouldn’t have to resort to this !
Also, can’t get the output through pipefor i in $(ls); do zcat $i || cat $i; done | grep mysearchterm
this appears to workfind . -type f -print0 | xargs -0 -I{} sh -c 'zcat "{}" 2>/dev/null || cat "{}"' | grep "mysearchterm"
Still, that was a speed bump that I guess everyone dealing with mass compressed log files has to figure out on the fly because zcat can’t read uncompressed files ! argg !!!for i in $(ls); do zcat $i 2>/dev/null || cat $i; done | grep mysearchterm