Sometimes when working in a shell, you need to kinda keep track of what you are doing because it's likely not the last time you'll do it
Sometimes though, it's not worth building a shell script, testing it a bunch, whatever. You're just toying w/ something and you need to take notes inline with what you're doing without constantly going back to a text editor elsewhere and saving what you are about to run or just ran
Make an app that will help you watch what you are doing and help you serialize your tasks
Assuming the app was called "trackr"...
Before you started doing something you would call "trackr start - install test postgres instance" or something to say you're starting
Then, you may run "trackr start sub - fetch and extract tarball" to make a sub task
Then you run wget to fetch the tarball and untar it, but say you messed up the command, so you delete it and run it again or whatever. Often working with a shell is interactive and we take two steps forward and one step back
There can be commands like "trackr scratch that" and "trackr that was good" that help you know your good path
If you messed up something, you can run something like "trackr note - postgres tarball doesn't have it's own folder"
Then maybe "trackr success" or "trackr success sub" (it will probably ask Y/n if you want to consider it a success)
This type of flow can generate a decent report of what you did. The mess ups may be serialized in the report, but not immediately visible unless you make them.
Sure the report is sloppy, the goal of this tool is not to make sure you call "trackr whatever" exactly right, but to just give yourself a rough outline of what you did
The report can be cleaned up if necessary, it's probably just a markdown file with commands as 4-indent code
Can also have the start connect to a remote instance and help you in general find your snippets and see what you have done. Everyone gets annoyed when they know they have done something before but did not save it somewhere for future use
Plenty of commands e.g. start, success, fail, note, scratch, sensitive (to not log something), remember as (to save named snippets), etc
I often (or try to often) use 'script' to do this. Injecting '# doing xyz' occasionally is kinda like the 'trackr note' concept. https://github.com/dvorka/hstr is also another project to possibly pull inspiration from.