osx - How to find a specific file(txt) in a specific directory(-mmin -1)? -
/usr/local/bin/growlnotify -m 'looking subtitles...' found='find /users -type d -mmin -1' found1='find $found/*.txt' if [ -d "$found1" ]; /usr/local/bin/growlnotify -m "subtitles downloaded!" else /usr/local/bin/growlnotify -m "could not download subtitles" fi i trying write bash script locate folder in app downloaded subtitles , inform user using growl if present or not.
$found gives me list of directories, not know how 1 want..
please =)
sorry english
thanks answers! used, , seems working fine:
for file in "$@" if [ -e "${file%.*}.txt" ]; /usr/local/bin/growlnotify -a inapi -m "napisy zostały pobrane!" else /usr/local/bin/growlnotify -a inapi -m "nie udało się pobrać napisów." fi done
Comments
Post a Comment