Readline and therefore Bash have a very useful command called
operate-and-get-next, bound by default to Ctrl-O, that executes the current line, after selecting it from the history, and advances the history pointer by one, instead of clearing the command line prompt, as Enter would do.
So if you wish to repeat a number of sequential commands you did recently, one by one in the same order, you can:
- recall the first command in the sequence from the history
- execute it with Ctrl-O
- check the output
- check that the commandline is now pointing to the next command in the sequence
- GOTO 2.
Does Fish have anything like this, or can it be implemented as a function?