Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Usernames with dots



I apologize, it appears we are running older versions of zsh on some of our
systems.  (Versions 4.2.6, and 4.3.6)

I just tested with two newer versions (on my laptop, and a new version
compiled on my workstation (4.3.11 and 4.3.15) and these both seem to work.
 I will have to have the system admins install newer versions.

Thanks,

On Tue, Feb 14, 2012 at 11:58 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx>wrote:

> On Feb 14, 10:12am, Seth Underwood wrote:
> }
> } At my work, all user names have a dot (usually First.Last).  This naming
> } convention causes the ~username shortcut to not work in zsh.
>
> I think you may be mis-diagnosing the problem.  What does "to not work"
> mean here, more precisely?
>
> This man page bit that you quoted:
>
> } Static named directories
> }        A  `~'  followed  by anything not already covered consisting of
> any
> } number of alphanumeric
> }        characters or underscore (`_'), hyphen (`-'), or dot (`.') is
> looked
> } up as a named  direc-
> }        tory,  and  replaced by the value of that named directory if
> found.
>
> That means that a dot is explicitly included among the characters that
> may come after a tilde as part of a user name.
>
> What does
>                print -l ${(k)userdirs}
> show you?
>
> Any user names not included in that output will not be available for
> tilde-expansion.  The userdirs variable is populated by querying your
> operating system for available user names, so if it is incomplete then
> the system is in some way preventing zsh from listing all the users.
>
> } Is there a way in zsh to change this behavior?
>
> I'm not sure I'm answering the right question because it's not obvious
> what behavior (or lack thereof) is wrong, but you can explicitly add
> the user names you care about like so:
>
>    hash -d First.Last=/home/First.Last
>
> Replace /home/ with the appropriate path prefix for your environment.
>
> Other fixes (likely outside zsh) may be possible depending on whether
> $userdirs is incomplete and why.
>
> --
> Barton E. Schaefer
>



-- 
Seth Underwood
underwoo@xxxxxxxxx


Messages sorted by: Reverse Date, Date, Thread, Author