exc="/data/local/tmp/1/|/data/local/tmp/2/"
mkdir -p $p1/1 $p1/2
#set -f #globbing off, no changes with this flag
#here i add * to end of each folder
[ "$exc" ] && exc="--exclude '$(sed 's@/|@/*|@g; s@/$@/*@'
Источник: [url]https://stackoverflow.com/questions/78133237/substitute-problem-shell-inotify-wot-working-properly[/url]
Wrote a script to monitor folders with exclude option with inotifywait and trapped into problem with substitution in command. Script: [code]exc="/data/local/tmp/1/|/data/local/tmp/2/" mkdir -p $p1/1 $p1/2 #set -f #globbing off, no changes with this flag #here i add * to end of each folder [ "$exc" ] && exc="--exclude '$(sed 's@/|@/*|@g; s@/$@/*@'