• Badabinski@kbin.earth
      link
      fedilink
      arrow-up
      4
      ·
      2 days ago

      I was waiting for someone to come along with this response lmao

      I’m terrible at remembering shell string operation syntax, but this is the ultimate answer.

        • Badabinski@kbin.earth
          link
          fedilink
          arrow-up
          3
          ·
          2 days ago

          Idk, writing POSIX-compliant shell is so miserable that I avoid doing it when I can. You can use Bash on BSD and all other unixes, so it’s still a relatively portable solution.

          • sik0fewl@lemmy.ca
            link
            fedilink
            arrow-up
            2
            ·
            2 days ago

            True enough, but it’s pretty much the same to use sed, unless you need those milliseconds of performance boost.