Created
          June 8, 2016 07:42 
        
      - 
      
- 
        Save cslarsen/f7a92694ed445e9e881c9fed73b87cdc to your computer and use it in GitHub Desktop. 
Revisions
- 
        cslarsen created this gist Jun 8, 2016 .There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ #!/bin/bash if [ $# -eq 0 ]; then echo "Usage: pwait <PID>" echo "Waits until PID has terminated, then continues." echo "Example: pwait 123 && echo DONE" exit 1 fi for pid in "$@"; do while [ -e /proc/$pid ]; do sleep 0.1 done done