in reply to Re: Generating a grep command at run time
in thread Generating a grep command at run time
There is a small difference if you are searching more than one file, since grep pattern file1 file2 shows the file names on the output, ...Not if you use '-h'. Anyway, I would probably do the whole thing in perl, unless speed was really that much of an issue. And if it is (saving minutes or hours), then you might be able to do:
perl -e ' # Generate pattern and file names... exec 'grep', '-e', $pattern, @files; ' [args...]
|
|---|