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

Dak Ghatikachalam dghatikachalam at gmail.com
Fri Jan 26 06:51:30 UTC 2007

I write shells script extensively , I have noticed

~      -> gets a subsitution for $HOME
~userid   - >gets you the $HOME for that user

meaning if  you have  have logged in as root and  if you want to run some
script on oracle home even though you logged in as root  you can simplly

~oracle/runme.sh  -- > will run the runme.sh in Oracle home directory


On 1/25/07, youshi10 at u.washington.edu <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.
> TIA,
> -Garrett
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
> freebsd-questions-unsubscribe at freebsd.org"

More information about the freebsd-questions mailing list