wait-for-file 264 Bytes Edit Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #!/bin/sh set -eu file="$1" total=0 while [ "$total" -lt 10 ]; do if sudo test -f "$file"; then exit 0 fi sleep 1 total=$(($total + 1)) done echo "E: $file not found! Other files in the same directory:" >&2 sudo ls -1d $(dirname $file)/* >&2 exit 1