- Dec
- 48
- 1
Grab list of files then pass filenames on the command line -- preferably on the same command line!
Does anyone know of a convenient "coding metaphor" or pattern for doing the following?
Assume I have some external program, for example, a programmer's editor (let's call it "Ed" for convenience).
I can list a bunch of filenames on the command line following "Ed" and it will open those files or do whatever it does with them.
The program can't be passed anything like an "include list file" (single file containing paths to other files).
Now, suppose I want to build the list of files from some filter (or something like a FOR command) and then use it.
Let's assume that If I call the same program repeatedly, it will start separate instances, and I want a single instance, so I can't do something like the following:
I used to know how to do this! The best thing I can think of now, on short notice, is to build up an environment variable and use it, then drop it...
Any ideas?
Does anyone know of a convenient "coding metaphor" or pattern for doing the following?
Assume I have some external program, for example, a programmer's editor (let's call it "Ed" for convenience).
I can list a bunch of filenames on the command line following "Ed" and it will open those files or do whatever it does with them.
The program can't be passed anything like an "include list file" (single file containing paths to other files).
Now, suppose I want to build the list of files from some filter (or something like a FOR command) and then use it.
Let's assume that If I call the same program repeatedly, it will start separate instances, and I want a single instance, so I can't do something like the following:
> for /h /r %ff in (*something*.txt) do Ed "%ff"
I used to know how to do this! The best thing I can think of now, on short notice, is to build up an environment variable and use it, then drop it...
> unset flist & for /h /r %ff in (*something*.txt) do (set flist=%ff %flist ) & Ed %flist & unset flist
Any ideas?