|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I have the following in my .zshenv: export loc=$HOME/local export bin=$loc/bin export wrk=$loc/work .... (The ... stands for similar assignments of directory names to shell variables.) All these assignments, with the exception of the one for bin, produce the desired results when I use the corresponding "~xyz" construct. I.e. "~xyz" gets expanded to the directory named in the shell variable $xyz: % echo $loc /home/jones/local % cd ~loc % pwd /home/jones/local % echo $wrk /home/jones/local/work % cd ~wrk % pwd /home/jones/local/work But not so for $bin/~bin: % echo $bin /home/jones/local/bin % cd ~bin % pwd /bin Does anyone understand why "cd ~bin" takes me to /bin and not to /home/jones/local/bin (i.e. the directory named in $bin)? TIA! kj -- NOTE: In my address everything before the first period is backwards; and the last period, and everything after it, should be discarded. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
2007-07-27, 17:47(+00), kj:
[...] > I have the following in my .zshenv: > > export loc=$HOME/local > export bin=$loc/bin [...] > % cd ~bin > % pwd > /bin > > Does anyone understand why "cd ~bin" takes me to /bin and not to > /home/jones/local/bin (i.e. the directory named in $bin)? [...] Many systems have a user called "bin". cd ~bin takes you to that user's home directory. -- Stéphane |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
In <slrnfake4c.c6l.stephane.chazelas@spam.is.invali d> Stephane CHAZELAS <this.address@is.invalid> writes:
>2007-07-27, 17:47(+00), kj: >[...] >> I have the following in my .zshenv: >> >> export loc=$HOME/local >> export bin=$loc/bin >[...] >> % cd ~bin >> % pwd >> /bin >> >> Does anyone understand why "cd ~bin" takes me to /bin and not to >> /home/jones/local/bin (i.e. the directory named in $bin)? >[...] >Many systems have a user called "bin". >cd ~bin >takes you to that user's home directory. Thanks. That's exactly the case here. I should have guessed that! kj -- NOTE: In my address everything before the first period is backwards; and the last period, and everything after it, should be discarded. |
|
![]() |
| Outils de la discussion | |
|
|