• bad_news@lemmy.billiam.net
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    5 days ago

    I make ~/bin scripts that can be saved, then you have a backlog of real, backed up scripts you can add to path anywhere

    • MajorHavoc@programming.dev
      cake
      link
      fedilink
      arrow-up
      5
      ·
      4 days ago

      I’m an apprentice to both your ways.

      I create a tidy backed up script in ~/bin, and then I only ever evoke it from my bash history, because otherwise I don’t remember I had it.

    • esa@discuss.tchncs.de
      link
      fedilink
      arrow-up
      2
      ·
      4 days ago

      Yeah, that’s what I do for complex stuff. Aliases are pretty handy too, but I use them for stuff like “v=nvim” and “vd=nvim -d”. Also one function for fd to “nvim $(rf -l $1)”

    • nous@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 days ago

      I do use scripts for more complex things. But even then I have a few very frequent one liners in my history that are 3-4 commands chained together that I have not bothered to convert. It tends to only be when they start to have logic in them that I will write a script for. Or more one off commands that are easier to edit in a multi line editor then trying to get everything right in the shells prompt.