Я боюсь, что единственное решение, которое Вы имеете, состоит в том, чтобы соответствовать другой установке того же распределения и сбрасывать владельцев правильно.
Вы можете просто использовать grep
:
grep -Fwf fileA fileB
С man grep
:
-F, --fixed-strings
Interpret PATTERN as a list of fixed strings, separated by
newlines, any of which is to be matched. (-F is specified by
POSIX.)
-f FILE, --file=FILE
Obtain patterns from FILE, one per line. The empty file
contains zero patterns, and therefore matches nothing. (-f is
specified by POSIX.)
-w, --word-regexp
Select only those lines containing matches that form whole
words. The test is that the matching substring must either be
at the beginning of the line, or preceded by a non-word
constituent character. Similarly, it must be either at the end
of the line or followed by a non-word constituent character.
Word-constituent characters are letters, digits, and the
underscore.
Имеет ли значение порядок fileA? Можно ли иметь несколько строк в файле B с этим шаблоном? Это, например, проанализирует файлA и найдет каждый шаблон в файлеB:
while read i; do grep "$i" fileB; done < fileA
Но вам нужно лучше определить проблему, чтобы получить решение с большей производительностью. Например, достаточно получить всю строку, не нужно рассматривать ее как 26 значений.