Score:0

Fswatch observing folder for new files error from the example doc

br flag

I am trying to "listen in" on changes in a particular folder, then once a file comes in, I want to copy the file to another folder. I figured fswatch would be a great choice for this.

And as I'm reading through the official documentation of fswatch and I see this snippet of code:

fswatch -0 path | while read -d "" event \
  do \
    // do something with ${event}
  done

I convert it to my folder and to print info about the event like so:

fswatch -0 '/home/ubuntu' | while read -d "" event \
  do \
    echo "WOOOW ${event}"
  done

And I got this error -bash: syntax error near unexpected token done'`, anyone has suggestion how can I make this work?

Score:1
in flag

do must be preceded by a line break or a ;.

I suggest to remove \ after event.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.