Note that there are some explanatory texts on larger screens.

plurals
  1. POgrep through an explicit filelist
    primarykey
    data
    text
    <p>Stack,</p> <p>We have many files in our library that were never used in subsequent projects. We are now at a development phase where we can do some good housekeeping and carefully remove unused library code. I am trying to optimize my grep command, it's current implementation is quite slow.</p> <pre><code>grep --include=*.cpp --recursive --files-with-matches &lt;library function name&gt; &lt;network path to subsequent projects&gt; </code></pre> <p>The main reason is that the projects path is expansive and the bulk of the time is spent just navigating the directory tree and applying the file mask. This grep command is called many times on the same set of project files.</p> <p>Rather than navigating the directory tree every call, I would like to grep to reference a static filelist stored on my local disk.</p> <p>Something akin to this:</p> <pre><code>grep --from-filelist=c:\MyProjectFileList.txt </code></pre> <p>The <code>MyProjectFileList.txt</code> would be:</p> <pre><code>\\server1\myproject1\main.cpp \\server1\myproject1\func1.cpp \\server1\myproject2\main.cpp \\server1\myproject2\method.cpp </code></pre> <p>Grep would apply the pattern-expression to contents of each of those files. Grep output would be the fully qualified path of the project file that is uses a specific library function.</p> <p>Grep commands for specific library functions that return no project files are extraneous and can be deleted.</p> <p><strong>How do you force grep to scan files from an external filelist stored in a text file?</strong> (Thereby removing directory scanning.)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload