Question: Why doesn't -H work?

Alan Sparks asparks at
Wed Oct 15 21:52:36 EDT 2003

Malton, Craig said:
> sudo -H -u db2as echo $HOME
> I'm running this as user cmalton and $HOME keeps returning as
> /home/cmalton not /export/home/db2as.  Does anyone know why -H isn't
> working for me?

Because $HOME is expanded by your shell /before/ the command is run,
not /when/ sudo is run.

Alan Sparks, Sr. UNIX Administrator     asparks at
Quris, Inc.                             (720) 836-2058

More information about the sudo-users mailing list