Is it possible to call a .exe file from a shell script running in Cygwin in order to pipe the result to a while read line loop?
The code I have tried is working in Linux (where inotifywait is the application I am trying in Cygwin and is installed in Linux)
I have found a .exe version of inotifywait for Windows but can not seem to get the read line loop to read from the pipe in Cygwin.
The below code is able to initialize inotifywait.exe from the shell script but never outputs any line to the Cygwin terminal.
DIR="c:/tmp"
./inotifywait -mr -e create,modify,delete,move \
--timefmt '%m/%d/%y %H:%M:%S' --format '%T;%f;%e;%w' $DIR |
while read line
do
echo $line
done