title: Is there a configuration-automator-with-macro-substitutions tool? Or could someone help me narrow this down?
body: <p>I'm looking for a basic automation tool; I don't know whether it doesn't exist, or if all of my google searches are still too generic. What I would like to do is start with a template file <code>file.in</code> and generate a target file <code>file.out</code> by running a tool (script?) to replace all occurrences of certain substitution strings with their definitions in a macro file <code>macros.txt</code>. More concretely, the macros file would contain entries like</p>
  
  <pre><code>PATH = /Users/me/mypath/...
  </code></pre>
  
  <p>And the template file would contain text like</p>
  
  <pre><code>"... change the working directory to @PATH@ and ... "
  </code></pre>
  
  <p>At the moment I'm accomplishing what I need by using CMake's <code>configure_file()</code>, but that seems too heavy handed for the task at hand. Ultimately the target files will be XML documents where I need to populate a few fields with configuration-dependent information. </p>