Often I have complicated installation procedures to follow, like having to build dependencies for buildtools, to build dependencies for the application I wish to install from source.
Once I have done this once, I don't really want to do have to try and remember all the steps I have done.
The command-history in zsh (and other shells) already records what I have done.
Is it possible to export the last 100 (for example) commands executed in to a
I could then edit this script, remove commands that are from before I started installing, and remove commands that were me making mistake, and be left with a install script I can give to someone else in a similar environment. (Or use myself on another machine.).
I suspect, that my command history is already stored in one of the dot-files in my home directory.