Skip to content

Instantly share code, notes, and snippets.

@davidszotten
Created March 14, 2019 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidszotten/389e6e12601a93b654f2b74e4fd1033f to your computer and use it in GitHub Desktop.
Save davidszotten/389e6e12601a93b654f2b74e4fd1033f to your computer and use it in GitHub Desktop.
bash trap
#!/bin/bash
trap "exit" INT TERM ERR
trap "kill 0" EXIT
python ps.py , &
python ps.py . &
wait
import sys
import time
n = 0
while True:
print(f'{sys.argv[1]} {n}')
time.sleep(1)
n += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment