3 # Wait until a given file appears
7 # $2 - maximum time to wait in seconds, default is 5 seconds
9 if [[ $# -lt 1 || $# -gt 2 ]]
11 echo "invalid arguments"
19 for i in `seq 1 $steps`
21 # -f does not work for special files (e.g. UNIX domain sockets), use ls
24 [ $? -eq 0 ] && exit 0
28 echo "File '$1' not available after $secs second(s)"