title: bash- Assigning a value to a string using a command (rev)
body: <p>I am trying to assign the value of a string to the reversed value of another string (via the 'rev' command).  I know the rev command is used like this:</p>
  
  <pre><code>$ echo "hello" | rev
  olleh
  </code></pre>
  
  <p>But what I am trying to do is something like this:</p>
  
  <pre><code>var="hello"
  rav=${$var | rev}
  </code></pre>
  
  <p>I know this isn't correct syntax and it doesn't work, but I was wondering if there was a way to assign a variable using a command, and if so how is it done?</p>