私はスクリプトを持っています
#!/bin/bash
set i=0;
while read line
do
echo "$line";
$i < cat "my.log" | grep -w "$line" | wc -l;
echo "$i";
if [ "$i" == 0 ]; then
cat $line << "notfound.txt"
fi
i=0;
done < "test.txt"
エラーを出している
./test.sh: line 13: warning: here-document at line 10 delimited by end-of-file (wanted `notfound.txt')
./test.sh: line 14: syntax error: unexpected end of file
私の目標は、変数 i の値をテストすることです。0 の場合、変数 $line に格納されている値をファイル「notfound.txt」にリダイレクトしたいと思います。