tail -n 8 $HISTFILE > script.sh
and very little to no editing is needed to make that useful. Shell is not a programming language, it's an interface to the OS, and thinking about it like a programming language is just asking for frustration.I guess this just isn’t obvious to me. Where do you see the boundary between “interface to the os” and “programming language”?