inotifywait を使用して while ループ内で読み取ると、何かが壊れます。スクリプトが壊れるだけの入力を受け取ることはありません。これは例です:
#!/bin/bash
scriptDir=$(pwd)
get_input() {
read userInput
echo $userInput echod
}
inotifywait -m -e modify,create,delete $scriptDir | while read alterationDetails
do
echo "something changed"
get_input
done
理想的には、「get_input」の代わりに、while ループで入力を受け取る別のスクリプトを呼び出せるようにしたいと考えています。例えば:
eval "node inputCatcher.js"