Created
March 14, 2019 16:06
-
-
Save davidszotten/389e6e12601a93b654f2b74e4fd1033f to your computer and use it in GitHub Desktop.
bash trap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
trap "exit" INT TERM ERR | |
trap "kill 0" EXIT | |
python ps.py , & | |
python ps.py . & | |
wait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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