Created
May 4, 2015 06:21
-
-
Save jamesmartin/082ae55cf8458384b980 to your computer and use it in GitHub Desktop.
Fork/exec a sub process, wait for it to rejoin and then print the status
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
| # Runs exec inside the fork in order to capture the output of the subprocess | |
| pid = fork { exec('ssh 127.0.0.1') } | |
| _, status = Process.waitpid2(pid) | |
| puts status.success? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment