News for hackers. Stuff that matters.
Re:Ask HN: Extendable" Shell Commands? by not_your_vase on Thursday December 11, 2025 @01:01PM (#46234744)
Hack:

    long-running-command &
    pid_of_long_running_cmd=$(pidof long-running-command)
    tail --pid=$pid_pf_long_running_cmd -f /dev/null && forgotten-command
Tail quits when $pid_pf_long_running_cmd disappears, and kicks off the forgotten-command. (It won't know however the exit code of the original cmd, so that's a drawback)
Re:Ask HN: Extendable" Shell Commands? by baobun on Thursday December 11, 2025 @01:04PM (#46234791)
Yeah, the problem here is it requires preparation and preemptively adding that '&' to the first command. It doesn't work for the "oh, right" situations. Running all commands this way by default wouldn't make life easier.

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.