PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > zsh conundrum: ~bin incorrectly expanded
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

zsh conundrum: ~bin incorrectly expanded

Réponse
 
LinkBack Outils de la discussion
Vieux 27/07/2007, 18h47   #1
kj
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut zsh conundrum: ~bin incorrectly expanded



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.
  Réponse avec citation
Vieux 27/07/2007, 19h25   #2
Stephane CHAZELAS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: zsh conundrum: ~bin incorrectly expanded

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
  Réponse avec citation
Vieux 28/07/2007, 18h06   #3
kj
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: zsh conundrum: ~bin incorrectly expanded

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.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h45.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09765 seconds with 11 queries