title: Bash "coalesce" functionality
body: <p>I'm trying to do the following on a single line:</p>
  
  <pre><code>if [ -z "$foo" ]
  then
      source "$foo/subdir/yo.sh"
  else
      source "$bar/yo.sh"
  fi
  </code></pre>
  
  <p>(note the subdir only present if foo is used). The simplest solution so far is:</p>
  
  <pre><code>source "${foo:-$bar}${foo:+/subdir}/yo.sh"
  </code></pre>
  
  <p>In other words, take either foo or bar, then append <code>/subdir</code> if foo exists. Is there a more elegant way to do this?</p>