Code and comments

  • it_a_me
    link
    fedilink
    arrow-up
    2
    arrow-down
    1
    ·
    1 year ago

    I’ve gotten tired of weird regex stuff in awk, sed, and grep, so I’ve moved to perl -E for all but the most basic of things.

    • bizdelnick@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      In most cases extended POSIX regexes are enough and looks the same as perl regexes.

      I also used perl until I needed to write highly portable scripts that can be run on systems without perl interpreter (e.g. some minimal linux containers). Simple things are also simple to do with grep/sed/awk, more complex things can be done with awk but require a longer code in comparison with perl.

      • SpaceNoodle@lemmy.world
        link
        fedilink
        arrow-up
        1
        arrow-down
        1
        ·
        1 year ago

        I’ve dealt with systems that lack sed and awk. Bash builtins and other standard tools like cut and tr take care of … well, everything.

        • bizdelnick@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          1 year ago

          Systems with bash but without standard POSIX utils? I know some without bash (freebsd by default, busybox based distros etc.) and with grep, sed and awk, but not vice versa.