title: Replacing placeholders with SED
body: <p>I'm trying to replace [[****]] placeholders in a html file with values from property file. </p>
  
  <p>Sample content in the input file: </p>
  
  <pre><code>&lt;html&gt;
  &lt;host&gt;[[my_host]]&lt;/host&gt;
  &lt;port&gt;[[my_port]]&lt;/port&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Sample content in property file:</p>
  
  <pre><code>my_host=linkcmb.com
  my_port=8080
  </code></pre>
  
  <p>My current script:</p>
  
  <pre><code>#/bin/sh
  
  property_file=$1
  input_html=$2
  output_html=$3
  
  IFS="="
  while read k v || [[ -n "$k" ]]; do
    test -z "$k" &amp;&amp; continue 
    declare $k=$v
  done &lt;"$property_file"
  
  eval "$(sed 's/\[\[\([^]]\+\)\]\]/${\1}/g' $input_html) &gt;$output_html";
  </code></pre>
  
  <p>Error: Html tags are getting evaluated too causing errors.</p>
  
  <pre><code>./some.sh: line 32: html: No such file or directory
  ./some.sh: line 33: host: No such file or directory
  ./some.sh: line 35: /host: No such file or directory   
  ....
  ....
  </code></pre>
  
  <p>Any advises will be much appreciated. Thanks. </p>