There I said it !

  • Malfeasant@lemm.ee
    ·
    45 minutes ago

    How do you propose zcat tell the difference between an uncompressed file and a corrupted compressed file? Or are you saying if it doesn't recognize it as compressed, just dump the source file regardless? Because that could be annoying.

      • allywilson@lemmy.ml
        ·
        2 hours ago

        Won't this cause cat to iterate through all files in the cwd once zcat encounters an issue, instead of just the specific file?

    • interdimensionalmeme@lemmy.ml
      hexagon
      ·
      edit-2
      12 hours ago

      Thanks !

      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

  • huf [he/him]
    ·
    edit-2
    11 hours ago

    zgrep . * should do the trick

    oh, there's also zcat -f *