Last active
November 7, 2022 16:16
-
-
Save cpelley/da3f3f43e2b3fb2288a78dd659d1d59a to your computer and use it in GitHub Desktop.
Testing gnu parallel behaviour
This file contains hidden or 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
| #!/usr/bin/python3 | |
| import sys | |
| from time import sleep | |
| import random | |
| for i in range(random.randint(3, 8)): | |
| sleep(random.random() / 10) | |
| print(f"{sys.argv[1]}, step {i}") | |
| if i == 2 and ("arg1" in sys.argv[1] or "arg2" in sys.argv[1]): | |
| raise ValueError(f"{sys.argv[1]} raised an exception") |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We can retain our error code AND still echo our 'endgroup' with a minor change: