News for hackers. Stuff that matters.
Re:Ask HN: Extendable" Shell Commands? by i15e on Thursday December 11, 2025 @06:10PM (#46238645)
You can use Ctrl+z to suspend the foreground process, bg to resume it in the background, and then wait to wait for it to complete. By default wait will wait for all jobs to finish and then return a success exit code, however if you give it a specific job ID it will instead return the exit code of the waited-on process:

    $ (sleep 10; false)
    ^Z
    [1]+  Stopped                 ( sleep 10; false )
    $ wait %% && echo ok || echo nok
    [1]+  Exit 1                  ( sleep 10; false )
    nok
Re:Ask HN: Extendable" Shell Commands? by baobun on Thursday December 11, 2025 @07:11PM (#46239242)
Great! And no plugins or scripts needed. Thank you!