Why Nostr? What is Njump?
2025-03-05 18:45:31

Scott Williams 🐧 on Nostr: Want to trigger some #bash action once a process is finished? Find the pid of the ...

Want to trigger some #bash action once a process is finished? Find the pid of the process with `ps` or `top` (1234 in this example) and then:

while ps 1234 ; do sleep 5 ; done ; git add . && git commit -m 'Updated dependencies.'

The commands after the `done;` will happen once the process finishes. Keep in mind that this will fire regardless of whether it finished successfully, but this is useful for triggering an action on an already long-running process.

#Linux #scripting
Author Public Key
npub1hmhz33j9p66ayxlegfuarul5refyepatlp3e8q6mghn2r6vrjrns0msatr