title: How do I specify default list values for bash variables?
body: <p>I understand the syntax:</p>
  
  <pre><code>foo=${bar:-mydefault}
  </code></pre>
  
  <p>which sets <code>foo</code> to <code>$bar</code> if it exists, and <code>mydefault</code> if not. This works for simple, scalar values. But I can't figure out how to set a default value for a list. I tried things like:</p>
  
  <pre><code>foo=${bar[@]:-(my de fault)}
  </code></pre>
  
  <p>but that does not work. It's the default value that trips me up, it does assign <code>${bar[@]}</code> as a list if it exists. How can this be done?</p>