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)”
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.
I make ~/bin scripts that can be saved, then you have a backlog of real, backed up scripts you can add to path anywhere
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.
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)”
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.