Bugzilla – Bug 56
-H ignored without -s
Last modified: 2001-11-08 18:58:53 MST
Feature or bug? The -H switch seems be ignored unless coupled with -s. For example: [puma:~] foo% sudo -H -u bar echo ~Password:/Users/foo[puma:~] foo% sudo -s -H -u bar[puma:/Users/foo] bar% echo ~/Users/bar This is on Mac OS X 10.1.
That didn't wrap correctly. Maybe this will: [puma:~] foo% sudo -H -u bar echo ~ Password: /Users/foo [puma:~] foo% sudo -s -H -u bar [puma:/Users/foo] bar% echo ~ /Users/bar
Nope, the '~' is being expanded by your shell before sudo even runs. A better test is: % sudo -H printenv | grep HOME HOME=/root