* Named directories expansion
@ 2004-06-09 16:21 DervishD
2004-06-10 15:43 ` Bart Schaefer
2004-06-10 15:52 ` Bart Schaefer
0 siblings, 2 replies; 4+ messages in thread
From: DervishD @ 2004-06-09 16:21 UTC (permalink / raw)
To: Zsh Users
Hello all :)
Lets say I have a named directory:
typeset -gx X=/var/X
And I want to do something like:
list=(**/*~(/explicit/path|~X))
Will the named dir be expanded inside the expression? It doesn't
seems to be... In the manual I've read that each word is checked to
see if it starts with an unquoted '~', is that quoted inside a (...)
expression?
Thanks a lot for your help :)
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Named directories expansion
2004-06-09 16:21 Named directories expansion DervishD
@ 2004-06-10 15:43 ` Bart Schaefer
2004-06-10 16:34 ` DervishD
2004-06-10 15:52 ` Bart Schaefer
1 sibling, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2004-06-10 15:43 UTC (permalink / raw)
To: Zsh Users
On Wed, 9 Jun 2004, DervishD wrote:
> list=(**/*~(/explicit/path|~X))
>
> Will the named dir be expanded inside the expression?
No.
> In the manual I've read that each word is checked to see if it starts
> with an unquoted '~', is that quoted inside a (...) expression?
It's not quoted, but it's also not the start of a word. "Word" here has
the very specific meaning of a shell-parser syntactic word, which means
that a word "starts" only immediately after an unquoted $IFS character, or
(as a special case) after a colon found to the right of the equal sign in
certain assignment expressions.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Named directories expansion
2004-06-10 15:43 ` Bart Schaefer
@ 2004-06-10 16:34 ` DervishD
0 siblings, 0 replies; 4+ messages in thread
From: DervishD @ 2004-06-10 16:34 UTC (permalink / raw)
To: Zsh Users
Hi Bart :)
* Bart Schaefer <schaefer@brasslantern.com> dixit:
> > In the manual I've read that each word is checked to see if it starts
> > with an unquoted '~', is that quoted inside a (...) expression?
> It's not quoted, but it's also not the start of a word.
OK, I understand, now. I had it running using $X instead of ~X,
since all named directories are, AFAIK, shell parameters too. I'll
try not to forgot what is a word and what is not :) Thanks a lot,
Bart :)
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Named directories expansion
2004-06-09 16:21 Named directories expansion DervishD
2004-06-10 15:43 ` Bart Schaefer
@ 2004-06-10 15:52 ` Bart Schaefer
1 sibling, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2004-06-10 15:52 UTC (permalink / raw)
To: Zsh Users
Sorry, one further thought ...
On Wed, 9 Jun 2004, DervishD wrote:
> list=(**/*~(/explicit/path|~X))
All you need is to replace the tilde with a dollar:
list=(**/*~(/explicit/path|$X))
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-06-10 17:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-09 16:21 Named directories expansion DervishD
2004-06-10 15:43 ` Bart Schaefer
2004-06-10 16:34 ` DervishD
2004-06-10 15:52 ` Bart Schaefer
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).