title: Shell script: Replace matching text with output of program
body: <p>I want to replace specific strings in a text stream with the output of a program run on those strings.  For example, replace any occurrence of "#filename#" with the output of <code>identify filename</code></p>
  
  <p>Is there any easy way to do this?</p>