title: How to replace placeholder character or word in variable with value from another variable in Bash?
body: <p>I'm trying to write a simple Bash script. I have a simple "template" variable:</p>
  
  <pre><code>template = "my*appserver"
  </code></pre>
  
  <p>I then have a function (<code>get_env()</code>) that returns the values <code>dev</code>, <code>qa</code>, or <code>live</code>. I'd like to call <code>get_env</code> and then string-replace the <code>template</code> variable with <code>get_env</code>'s return value and swap it out with the asterisk. So:</p>
  
  <pre><code># Returns "dev"
  server = get_env
  
  # Prints "mydevappserver"
  template = string_replace(server, template)
  </code></pre>
  
  <p>Or:</p>
  
  <pre><code># This time, it returns "live"
  server = get_env
  
  # Prints "myliveappserver"
  template = string_replace(server, template)
  </code></pre>
  
  <p>What should I be using in lieu of this <code>string_replace()</code> function to accomplish the binding? </p>