Skip to content

Commit

Permalink
Add SUDO_PATH to sudo
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Mar 14, 2013
1 parent ddbe8dd commit d2b6c11
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zshenv
Expand Up @@ -48,9 +48,12 @@ typeset -U sudo_path
## /: ディレクトリのみ残す。
sudo_path=({,/usr/pkg,/usr/local,/usr}/sbin(N-/))

# rootの場合はsudo用のパスもPATHに加える。
if [ $(id -u) -eq 0 ]; then
# rootの場合はsudo用のパスもPATHに加える。
path=($sudo_path $path)
else
# 一般ユーザーの場合はsudo時にsudo用のパスをPATHに加える。
alias sudo="sudo env PATH=\"$SUDO_PATH:$PATH\""
fi

# man用パスの設定
Expand Down

0 comments on commit d2b6c11

Please sign in to comment.