Подскажите, пожалуйста.
В обоих файлах есть по несколько вхождений email. Нужно вывести в цикле первый id из файла emails_ids (если идти по списку сверху вниз) для каждого email из файла emails.
И это работает, но если попробовать grep’ать в цикле, то получаю такой результат:
$ for i in `cat emails`; do grep "$i" emails_ids|awk '{print $2}'|head -1; done
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
grep: Unmatched [, [^, [:, [., or [=
Не совсем понимаю, из-за чего так происходит и как правильно реализовать? Спасибо!