Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

~bin and ~/bin ??

0 views
Skip to first unread message

Boab

unread,
Sep 17, 2004, 8:32:13 AM9/17/04
to
Hi All,

Quick query on something i dont understand!!! there are many

echo ~
/home/myprod/myprod

echo ~/bin
/home/myprod/myprod/bin

Which I am okay with and totaly understand but why does

echo ~bin
give
/usr/bin

I dont understand how the shell interperets ~bin???

Laurenz Albe

unread,
Sep 17, 2004, 8:44:32 AM9/17/04
to
Boab <goo...@robertbrewer.co.uk> wrote:
> Which I am okay with and totaly understand but why does
>
> echo ~bin
> give
> /usr/bin
>
> I dont understand how the shell interperets ~bin???

You forgot to say which shell you are using.

Your shell expands ~bin to the home directory of the user 'bin'
(see /etc/passwd).

Laurenz Albe

Bruce Barnett

unread,
Sep 17, 2004, 8:42:17 PM9/17/04
to

~ usually means the value of the environment variable $HOME

~xxx requires the shell to read /etc/passwd, find the user "xxx" , and
extract the home directory for that user.


--
Sending unsolicited commercial e-mail to this account incurs a fee of
$500 per message, and acknowledges the legality of this contract.

0 new messages