Skip to content
Commit f46d06da authored by Henrik Holm's avatar Henrik Holm
Browse files

Correct redirection of output from 'hash'

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
  [~]$
parent 70dfb91b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment