summaryrefslogtreecommitdiffstats
path: root/pidwait.sh
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-03-25 20:14:57 +0100
committerFlorian Pritz <bluewind@xinu.at>2015-03-25 20:14:57 +0100
commit563576ff0e054ac73ebf92388e7107bdf7240bad (patch)
tree7384372e8feab4b8a7cd28be6ef9337f5654f2e2 /pidwait.sh
parent964185d1a267ddcf79ac3517bc7145a141ea3c32 (diff)
downloadbin-563576ff0e054ac73ebf92388e7107bdf7240bad.tar.gz
bin-563576ff0e054ac73ebf92388e7107bdf7240bad.tar.xz
add pidwait.sh
Signed-off-by: Florian Pritz <bluewind@xinu.at>
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