e-letter wrote: > File 1 contains data: > /some/text/abcd.xyz > > File 2: > abcd.xyz > > The manual does not seem to indicate that regular expressions can be > used with 'comm'.
They can't be. It doesn't make sense for comm. Perhaps you should be using 'grep' or 'sed'? > The task is to be able to compare file1 to file2 using a regular > expression as a criterion for comparison, such as: > > *cd.xyz > > Then create a new file 'file3' that contains only those lines that > satisfy the regular expression, but must contain the same format style > as in file1. Sounds like a homework assignment. > Any help please? $ grep -F cd.xyz file1 > file3 Or perhaps: $ grep -f file2 file1 > file3 But note that "*cd.xyz" doesn't make sense as a regular expression. It looks like a file glob match instead. Watch that string being used for a regular expression carefully. Perhaps "cd\.xyz" instead. Good luck on working through your homework! :-) Bob
