There I said it !

  • LemoineFairclough@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 month ago

    I think that providing an exit status that is not 0 when zcat is used with an uncompressed file is useful. Though my opinion is less strong regarding whether it should write more text after an error occurred, it’s probably more useful for a process to terminate quickly when an error occurred rather than risk a second error occurring and making troubleshooting harder.

    I think that trying to change any existing documented features of widely used utilities will lead to us having less useful software in the future (our time is probably better spent making new programs and new documentation): https://www.jwz.org/doc/worse-is-better.html https://en.wikipedia.org/wiki/Worse_is_better

    • interdimensionalmeme@lemmy.mlOP
      link
      fedilink
      arrow-up
      0
      ·
      1 month ago

      Not improving existing software leads to stagnation.

      It’s certainly a good part of why so much of linux is an awkward kludgy idiosyncratic mess to use.

      Whatever the first implementation does ends up being a suicide pact by default.

      Another option is to change cat to auto decompress compressed files, instead of printing gibberish.

      • LemoineFairclough@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 month ago

        Whatever the first implementation does ends up being a suicide pact by default.

        I agree. The behavior of rm and cat and cp and mv and dd and many other utilities don’t necessarily have the interface I would prefer, but they are too widely used for it to be helpful to radically change them. It’s somewhat unfortunate that these names are already reserved, but I don’t think it’s necessary to change them.

        In the same way, I don’t have a problem with packages having generic names but not actually being useful: I’ve read that the requests and urllib3 packages for Python aren’t being maintained very well, but I don’t mind that as long as I can accomplish things while following best practices.

        Because of this, I’m not afraid to use names like “getRequest” or “result”, especially if they were generated with an automatic refactoring, and I’m not upset when I see similarly generic names being used with source code I’m changing, since I know that the second name for something that’s similar to an existing thing will have to actually be descriptive, but the first name is likely to not be.

        I have another example of how I’d apply these thoughts: the process for developing v2+ modules for the Go programming language strikes me as inelegant, so I would probably prefer to just create an entirely new repository rather than try to attempt that.

  • elmicha@feddit.org
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    I agree. zgrep also works for uncompressed files, so we could use e.g. zgrep ^ instead of zcat.

  • fool@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    1 month ago

    just use -f lol.

    less $(which zcat) shows us a gzip wrapper. So we look through gzip options and see:

    -f --force
    Force compression or decompression. If the input data is not in a format recognized by gzip, and if the option --stdout is also given, copy the input data without change to the standard output: let zcat behave as cat.

    party music