title: Can multiple BASH variable manipulations be used at once?
body: <p>Is it possible to perform more than one bash variable manipulation in one shot?</p>
  
  <p>For example:</p>
  
  <pre><code># for this variable
  foo="string_that_is_lower"
  
  # can I do this in one shot?
  $foo="${foo:0:4}"
  echo "${foo^^}"
  </code></pre>
  
  <p>Is there a way to combine these? I realize this is a trivial problem because this works just fine, or one could simply use other built in tools like <code>echo ${foo:0:4} | tr [[:lower:]] [[:upper:]]</code>, but that is lame.</p>
  
  <p>I've tried every logical combination I can think might work:</p>
  
  <pre><code>${${foo^^}:0:4}
  ${{foo^^}:0:4}
  ${foo^^,:0:4}
  ${foo^^;:0:4}
  ${foo^^ :0:4}
  </code></pre>
  
  <p>All produce syntax errors.</p>
  
  <p>I find no instances of "(combine|multiple) bash variable manipulations" in the <a href="https://www.tldp.org/LDP/abs/html/string-manipulation.html" rel="noreferrer">Advanced Bash</a> <a href="https://www.tldp.org/LDP/abs/html/parameter-substitution.html" rel="noreferrer">Scripting Manual</a>, or the manpage, or Google, or here, so maybe you just can't do it, but probably I'm just not searching for the right terms.</p>