2 ms·
+1 to this. I've been using it for a while. It doesn't do a great deal, the magic is that it removes just enough hassle from the shell scripting process that I
by _dain_ 4y ago
+1 to this. I've been using it for a while.
It doesn't do a great deal, the magic is that it removes just enough hassle from the shell scripting process that I write far more than I used to.
- I don't have to worry about accidentally giving my scripts names that collide with other things on my computer, because they all live in the sd namespace. It's kind of like the Vim leader key, but for the shell.
- I don't worry about forgetting about my scripts later on, because I can browse them with tab completion.
- I'm motivated to write a 1-line documentation comment explaining wtf the script does, again because the comment gets picked up by the tab-completion and displayed as description.
Now I have a growing collection of little scripts organized with sd. Many of them are trivial one-liners. Some of them are even just stuff I could accomplish with bash syntax but kept forgetting how to do because punctuation is harder to remember than words. Previously I would write these things but then forget about them later on, negating the point. And the worry of forgetting made me not write scripts in the first place. I don't have to worry about forgetting to write `set -euo pipefail` because it does it for me.