• conditional_soup@lemm.ee
    link
    fedilink
    arrow-up
    8
    ·
    edit-2
    4 months ago

    Regex

    Edit: to everyone who responded, I use regex infrequently enough that the knowledge never really crystalizes. By the time I need it for this one thing again, I haven’t touched it in like a year.

    • 9point6@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      4 months ago

      You get used to it, I don’t even see the code—I just see: group… pattern… read-ahead…

    • kameecoding@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      4 months ago

      Most of regex is pretty basic and easy to learn, it’s the look ahead and look behind that are the killers imo

    • Kissaki@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      4 months ago

      You always forget regex syntax?

      I’ve always found it simple to understand and remember. Even over many years and decades, I’ve never had issues reading or writing simple regex syntax (excluding the flags and shorthands) even after long regex breaks.

      • Akito@lemmy.zip
        link
        fedilink
        English
        arrow-up
        2
        ·
        4 months ago

        It’s not about the syntax itself, it’s about which syntax to use. There are different ones and remembering which one is for which language is tough.

        • activ8r@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          1
          ·
          4 months ago

          I know that LLMs are probably very helpful for people who are just getting started, but you will never understand it if you can’t grasp the fundamentals. Don’t let “AI” make you lazy. If you do use LLMs make sure you understand the output it’s giving you enough to replicate it yourself.

          This may not be applicable to you specifically, but I think this is nice info to have here for others.

  • wwb4itcgas@lemm.ee
    link
    fedilink
    English
    arrow-up
    2
    ·
    4 months ago

    I have a confession to make: Unless shell script is absolutely required, I just use Python for all my automation needs.

    • CrazyLikeGollum@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 months ago

      Or scripts for basically any other variant of the Bourne shell. They are, for the most part, very cross compatible.

      • Tinidril@midwest.social
        link
        fedilink
        English
        arrow-up
        2
        ·
        4 months ago

        That’s the only reason I’ve ever done much of anything in shell script. As a network administrator I’ve worked many network appliances running on some flavor of Unix and the one language I can count on to be always available is bash. It has been well worth knowing for just that reason.

  • Pixelbeard@lemmy.ca
    link
    fedilink
    Français
    arrow-up
    1
    ·
    4 months ago

    Je comprend tellement! Je répond en français pour ma première réponse sur Lemmy juste pour voir comment ça va être géré!

  • Victor@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    4 months ago

    Ever since I switched to Fish Shell, I’ve had no issues remembering anything. Ported my entire catalogue of custom scripts over to fish and everything became much cleaner. More legible, and less code to accomplish the same things. Easier argument parsing, control structures, everything. Much less error prone IMO.

    Highly recommend it. It’s obviously not POSIX or anything, but I find that the cost of installing fish on every machine I own is lower than maintaining POSIX-compliant scripts.

    Enjoy your scripting!

    • UndercoverUlrikHD@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      4 months ago

      If you’re going to write scripts that requires installing software, might as well use something like python though? Most Linux distros ship also ship with python installed

  • perishthethought@lemm.ee
    link
    fedilink
    English
    arrow-up
    0
    arrow-down
    1
    ·
    4 months ago

    I don’t normally say this, but the AI tools I’ve used to help me write bash were pretty much spot on.

    • marduk@lemmy.sdf.org
      link
      fedilink
      arrow-up
      0
      ·
      4 months ago

      Yes, with respect to the grey bearded uncles and aunties; as someone who never “learned” bash, in 2025 I’m letting a LLM do the bashing for me.

      • SpaceNoodle@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        4 months ago

        Until the magic incantations you don’t bother to understand don’t actually do what you think they’re doing.

        • MBM@lemmings.world
          link
          fedilink
          arrow-up
          0
          ·
          4 months ago

          I wonder if there’s a chance of getting rm -rf /* or zip bombs. Those are definitely in the training data at least.

          • furikuri@programming.dev
            link
            fedilink
            arrow-up
            1
            ·
            4 months ago

            The classic rm -rf $ENV/home where $ENV can be empty or contain spaces is definitely going to hit someone one day