[OT] Does "~" always point to $HOME?

Bill Campbell freebsd at celestial.com
Thu Jan 25 19:46:54 UTC 2007


On Thu, Jan 25, 2007, youshi10 at u.washington.edu wrote:
>Hello again,
>    I'm revising some documentation that has examples of running Unix 
>    commands and I want to make sure that my steps are correct, such that I 
>    can substitute the tilde character ('~') for $HOME. The only issue I 
>    can see with this is an improper configuration with sudo (ran into some 
>    problems with $HOME in the past using sudo on Gentoo), but I'm pretty 
>    sure that sudo's setup on the machine cluster properly.

That's true on most relatively modern shells, but not on pure
Bourne Shell, /bin/sh.

As for ``sudo'', ``sudo -'' invokes the login environment while a
plain ``sudo'' doesn't.

Bill
--
INTERNET:   bill at Celestial.COM  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676

``If we got one-tenth of what was promised to us in these acceptance
speeches there wouldn't be any inducement to go to heaven.''
    Will Rogers


More information about the freebsd-questions mailing list