Quantcast
Channel: Programming – Pete Shanahan's Shack
Viewing all articles
Browse latest Browse all 21

Cheap and cheerful pwait for linux

$
0
0
#!/bin/bash -p
if [ $# -eq 0 ]; then
echo "Usage: $(basename $0) " 1>&2
exit 1
fi
while [ -d /proc/$1 ]; do sleep 0.5; done

If I implemented it using inotify, I presume I can get rid of the sleep, but that entails compiled code.


Viewing all articles
Browse latest Browse all 21

Trending Articles