Ok, something is not "translating well."
You want a list of lines listed in
both fileA and fileB.
The command you gave in your last reply
will do that.
For example:
Code:
user@localhost$ cat fileA
package 1
package 2
package 3
package 4
package 5
package 6
user@localhost$ cat fileB
package 1
package 4
package 6
package 7
package 8
user@localhost$ comm -1 -2 fileA fileB
package 1
package 4
package 6
user@localhost$ comm -12 fileA fileB
package 1
package 4
package 6
user@localhost$ cat fileA fileB | sort | uniq -d
package 1
package 4
package 6
The last command is an alternative to comm.
To me, that satisfies your requirements. If the command is not producing the desired output on your end, then (1) the description of the requirements needs to be refined or (2) your data files are not "sanitized" (e.g. dos2unix, extra whitespace, mismatched lower/uppercase letters, etc.)
We would need to see real, actual sample data and the output you're getting.