summaryrefslogtreecommitdiffstats
path: root/pidwait.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pidwait.sh')
-rwxr-xr-xpidwait.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/pidwait.sh b/pidwait.sh
new file mode 100755
index 0000000..aeb97e1
--- /dev/null
+++ b/pidwait.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+if (($#<1)); then
+ echo "usage: ${0##*/} <pid>"
+ exit
+fi
+
+pid=$1
+
+while [[ -d /proc/$pid ]]; do
+ sleep 1
+done