
私はここで質問を検索してこのコマンドを構築しました。キーワードを手動で入力すると機能します。例:
while read line; do grep -wFrIin "keyword" --exclude-dir={.git,target} --include=\*.{java,ts,html} /path/to/project/; done < keywords.csv
しかし、キーワード ファイルの実際の内容を使用すると、結果は得られません。
while read line; do grep -wFrIin "$line" --exclude-dir={.git,target} --include=\*.{java,ts,html} /path/to/project/; done < keywords.csv
また、$line をエコーすると、次のキーワードが取得されます。
while read line; do echo "$line"; done < keywords.csv
\r\n または \n の問題かもしれないと思いましたが、改行のないファイル内にキーワードが 1 つしかない場合は、それでも機能しません...