DOC_PATTERN=".*\.(txt|doc|docx|rtf|pdf|sxc|csv|odt|odf|ods|xls|xlsx|ppt|epub|mobi|djvu|lit)"
FIND_OPTS="-not -path '*.git*' -regextype posix-egrep -iregex"
ITEM="$1"
+OPTION="$2"
DATE="`date +%s`"
MAX_AGE="86400"
grep -i -- "$*" $LIST
elif [ "$ITEM" == "--watch" ]; then
# Convert symlink to full path and start inotifywait loop
- #while inotifywait -e modify -e create -e move -e delete -r "`readlink -f $DOCS`"; do
- while inotifywait -e modify -e move -r "`readlink -f $DOCS`"; do
+ folder="`readlink -f $DOCS`"
+ subfolder="$OPTION"
+ echo "Watching changes at $folder/$subfolder..."
+
+ #while inotifywait -e modify -e create -e move -e delete -r "$folder"; do
+ #while inotifywait -e modify -e move -r "$folder"; do
+ #while inotifywait -e modify -e move -r "$folder/$subfolder"; do
+ while inotifywait -e modify -e create -e move -e delete -r "$folder/$subfolder"; do
$PROGRAM --refresh
done
else