0

I'm trying to use a variable to identify mxf or mov file extensions. The following works where I explicitly name the file extensions with a regular expression.

${FSWATCH_PATH} -0 \
-e ".*" --include ".*\.[ mxf|mov ]" \
--event Updated --event Renamed --event MovedTo -l $LATENCY \
$LOCAL_WATCHFOLDER_PATH \
| while read -d "" event
  do
<code here>
done

How can I use a variable for the file extensions, where the variable name is FileTriggerExtensions? The code below doesn't work:

FileTriggerExtensions=mov|mxf

${FSWATCH_PATH} -0 \
-e ".*" --include ".*\.[ $FileTriggerExtensions ]" \
--event Updated --event Renamed --event MovedTo -l $LATENCY \
$LOCAL_WATCHFOLDER_PATH \
| while read -d "" event
  do
done
Steve Piercy
  • 13,693
  • 1
  • 44
  • 57

1 Answers1

0

I guess you use Bash or a similar shell?

FileTriggerExtensions=mov|mxf
-bash: mxf: command not found

Use quotes or escape the pipe symbol.

hagello
  • 2,843
  • 2
  • 27
  • 37