zsh-users
 help / color / mirror / code / Atom feed
* tilde syntax
@ 2024-01-04 22:31 Ray Andrews
  2024-01-04 22:49 ` Bart Schaefer
  0 siblings, 1 reply; 15+ messages in thread
From: Ray Andrews @ 2024-01-04 22:31 UTC (permalink / raw)
  To: Zsh Users

     local zsh_case='(#i)'    # insensitive
     # Depending on options: zsh_case=''

     # Where input is some directory name, possibly incomplete and 
matches are looked for:

     subdirs=( $1*(/N) )

     subdirs=( (#i)$1*(/N) )

     subdirs=( $~zsh_case$1*(/N) ) # This works: but tilde must follow 
first dollar sign


The first two seem intuitive,  but the 3d, what does the tilde really 
do?  It has to be there, but one might expect '$zsh_case' to just 
substitute and all's well.  I used to understand this, I remember Roman 
explaining it, but I can't remember and my notes are sketchy.  The tilde 
turns globing into pattern matching, yes? But '(#i)' works if literal, 
it's not mistaken for a glob pattern so why should the use of a variable 
change anything?  Again, pardon, I used to know this.




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

end of thread, other threads:[~2024-01-06  3:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-04 22:31 tilde syntax Ray Andrews
2024-01-04 22:49 ` Bart Schaefer
2024-01-04 23:04   ` Ray Andrews
2024-01-04 23:40     ` Lawrence Velázquez
2024-01-05  0:12       ` Ray Andrews
2024-01-05  1:41         ` Lawrence Velázquez
2024-01-05  2:03           ` Ray Andrews
2024-01-05 14:41             ` Mark J. Reed
2024-01-05 16:42               ` Ray Andrews
2024-01-05 19:58                 ` Bart Schaefer
2024-01-05 22:50                   ` Ray Andrews
2024-01-05 23:27                     ` Bart Schaefer
2024-01-05 23:47                       ` Ray Andrews
2024-01-06  0:23                         ` Bart Schaefer
2024-01-06  3:44                           ` Ray Andrews

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).