zsh-users
 help / color / mirror / code / Atom feed
* Usernames with dots
@ 2012-02-14 15:12 Seth Underwood
  2012-02-14 15:44 ` Peter Stephenson
  2012-02-14 16:58 ` Bart Schaefer
  0 siblings, 2 replies; 4+ messages in thread
From: Seth Underwood @ 2012-02-14 15:12 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

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 found in
the zsh manual pages:

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.

Is there a way in zsh to change this behavior?

Thanks,

-- 
Seth Underwood
underwoo@gmail.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Usernames with dots
  2012-02-14 15:12 Usernames with dots Seth Underwood
@ 2012-02-14 15:44 ` Peter Stephenson
  2012-02-14 16:58 ` Bart Schaefer
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 2012-02-14 15:44 UTC (permalink / raw)
  To: zsh-users

On Tue, 14 Feb 2012 10:12:31 -0500
Seth Underwood <underwoo@gmail.com> 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 don't see why this wouldn't work.  It's supported in the code (that's
what the manual entry's supposed to say) and it does seem to work on my
system.

Is there anything else unusual about the password entry?

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Usernames with dots
  2012-02-14 15:12 Usernames with dots Seth Underwood
  2012-02-14 15:44 ` Peter Stephenson
@ 2012-02-14 16:58 ` Bart Schaefer
  2012-02-14 17:51   ` Seth Underwood
  1 sibling, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2012-02-14 16:58 UTC (permalink / raw)
  To: Seth Underwood, zsh-users

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Usernames with dots
  2012-02-14 16:58 ` Bart Schaefer
@ 2012-02-14 17:51   ` Seth Underwood
  0 siblings, 0 replies; 4+ messages in thread
From: Seth Underwood @ 2012-02-14 17:51 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

[-- Attachment #1: Type: text/plain, Size: 2097 bytes --]

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@brasslantern.com>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@gmail.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-14 17:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-14 15:12 Usernames with dots Seth Underwood
2012-02-14 15:44 ` Peter Stephenson
2012-02-14 16:58 ` Bart Schaefer
2012-02-14 17:51   ` Seth Underwood

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).