title: Script fails to see running as root
body: <p>This is my root check code. If does not pass don't run the script as you need root. Not sure as to what is going wrong here:</p>
  
  <pre><code>if [ "whoami &amp;2&gt;/dev/null" != "root" ] &amp;&amp; [ "id -un &amp;2&gt;/dev/null" != "root" ] ; then
      $BIN_ECHO " must be root to run this script "
      exit 1
  else
      $BIN_ECHO -e " permission check passed "
  fi
  </code></pre>
  
  <p>after running i get:</p>
  
  <pre><code>must be root to run this script
  [root@localhost ~]# whoami
  root
  [root@localhost ~]# id -un
  root
  </code></pre>