title: sudo: command: command not found on CentOS 6
body: <h2>MVCE:</h2>
  
  <p>on <code>bash 4.1.2</code>, <code>Centos 6.10</code> (because we're monsters).</p>
  
  <p><code>sudo command vim</code> </p>
  
  <p>returns </p>
  
  <p><code>sudo: command: command not found</code></p>
  
  <p>I don't understand why. on <code>bash 4.4.23</code>, <code>Mac OS High Sierra</code> it works as expected. It is very difficult to google this as people use "command" as a placeholder for various commands they are talking about.</p>
  
  <h2>Actual problem:</h2>
  
  <p>I have a function (seen below) named <code>vim</code>, taking the <code>command</code> out from its calls to vim <em>doesn't</em> cause it to fail, like I'd expect, on both bash 4.4 and 4.1.</p>
  
  <p>I have a function to automatically sudo vim if I can't write to file:</p>
  
  <pre><code>vim() {
      #only good for auto-sudo. delete if no sudo privileges.
      if [[ "$#" -ne 1 ]]; then
          command vim "$@"
      #cases: if we can write to the file, or the file doesn't exist but we can make new files in that dir
      elif [[ -w "$1" || ( -w $(dirname "$1") &amp;&amp; ! -f "$1" ) ]]; then
          # \vim or 'vim' only escape aliases, not functions
          command vim "$1"
      else
          #this 'command' isn't required! It won't loop forever without it.
          sudo env HOME="$HOME" command vim -u $HOME/.vim/vimrc "$1"
      fi
  }
  </code></pre>
  
  <p>I expect command to be required, since otherwise <code>vim</code> should refer to the function I made and call itself ad infinitum. However, not only is it <em>not</em> required, on both the CentOS and Mac systems, but also it causes the function to fail on the CentOS box! </p>
  
  <p>Can anyone explain this behavior?</p>
  
  <p>Is there a convenient bash changelog I can look at to know if "command" somehow wasn't implemented until after bash 4.1?</p>