Ask HN: Extendable" Shell Commands?
Simple example: Download this Linux ISO.. Oh, and flash it to my USB drive... Oh, and check the shasum... Oh, and show a notification when done.
Then the next time I want a slight variation of something more complex, every time I'm weighing the running time of the first process vs the time to type out or modify the second part.
I could open a separate shell and spawn a second process waiting for the first to finish but rarely worth the overhead of doing that.
So what I'd like is a "chainable shell" or "living prompt", where I can type out whatever comes next as the last shell command is already and still running in the foreground. Depending on the program, I noticed this kind-of already works where bash will actually go ahead and run whatever I type in the middle of the output of a blocking process once it's finished. But only for some programs.
Feels like something that hits most of us and should be possible to make something in bash/zsh for triggered by a keyboard shortcut. Yet I've never seen anything for this.
Anyone hacked together or found something like this that they use and would like to share?
But along those lines yeah, it's basically the same as the "wait for it in another terminal" approach and I guess a solution would contain something similar.
$ tsp yt-dlp <some URL>
# returns immediately, runs tasks in its own shell in the background one at a time (or can be parallel if you tell it to)
# can check status/stdout any time with tsp -t (including older/other queued commands)
# just queue a new command to run after the last one at any time
$ tsp ffmpeg -i <file that will be downloaded by yt-dlp> <other params>
etc.