• Henrik Holm's avatar
    Correct redirection of output from 'hash' · f46d06da
    Henrik Holm authored
    The intention of the redirection to /dev/null is to hide the output
    'hash: no such command: git' since we rely on the exit status.
    
    However, the output goes to stderr, so it's stderr that needs to be
    redirected. For completeness, we redirect both stderr and stdout using
    '2>&1'.
    
    Example:
    
      [~]$ hash git > /dev/null
      [~]$ PATH=''
      [~]$ hash git > /dev/null
      hash: no such command: git
      [~]$ hash git > /dev/null 2>&1
      [~]$
    f46d06da
install.sh 1.74 KB