title: How to store output from a bash command in a variable
body: <p>Hello I am trying to store an OS X command in a variable and I am having problems doing so. Here is my code:</p>
  
  <pre><code>#! /bin/bash
  Output=$(dscl . -read /Users/root AuthenticationAuthority)
  Check="No such key: AuthenticationAuthority"  
  
  if [ "$Output" = "$Check" ]
      then
         echo "OK"
        else
      echo "FALSE"
  fi
  </code></pre>
  
  <p>I have done this before with commands such as "defaults read...." and it works fine but the dscl . -read will not store the output in the variable. Any ideas?</p>