diff --git a/Library/Homebrew/shims/utils.sh b/Library/Homebrew/shims/utils.sh index 4b2090529e..13e4d2be27 100644 --- a/Library/Homebrew/shims/utils.sh +++ b/Library/Homebrew/shims/utils.sh @@ -1,7 +1,7 @@ set +o posix quiet_safe_cd() { - cd "$1" >/dev/null || { echo "Error: failed to cd to $1" >&2; exit 1; } + cd "$1" &>/dev/null || { echo "Error: failed to cd to $1" >&2; exit 1; } } absdir() { diff --git a/bin/brew b/bin/brew index 29d4ff2c8a..78eaa033b7 100755 --- a/bin/brew +++ b/bin/brew @@ -8,7 +8,7 @@ if ! [[ -d "${PWD}" ]]; then fi quiet_cd() { - cd "$@" >/dev/null || return + cd "$@" &>/dev/null || return } symlink_target_directory() {