In osx I am trying to detect when a new file is added to a folder, then execute a script to process that new file. Seems simple, right?
I am doing this:
fswatch -0 ~/motion-detection | xargs -0 -n1 -I {} ./detectmotion.sh
which will call the shell script detectmotion.sh which consists of:
echo "File added: " $1
for now, at least. I just want to pass the filename of the changed file to detectmotion.sh
I get a blank for $1
Can anyone see what I am doing wrong here?
Thanks in advance!