inotifywait To run command based on type of file modified inotifywait To run command based on type of file modified bash bash

inotifywait To run command based on type of file modified


Not the cleanest solution but works

#!/bin/shwhile file=$(inotifywait -r -e modify --format "%w%f" ./); do  EXT=${file##*.}  if [ $EXT = "styl" ]  then    stylus -c $file  fi  if [ $EXT = "coffee" ]  then    coffee -c $file  fidone

If you have a better solution that only watches the files I want, then I'm all ears