* Unexpected "unknown file attribute" error
@ 2001-11-09 1:22 Bart Schaefer
2001-11-12 12:28 ` Peter Stephenson
0 siblings, 1 reply; 2+ messages in thread
From: Bart Schaefer @ 2001-11-09 1:22 UTC (permalink / raw)
To: zsh-workers
For obscure reasons, one of the machines I use at work has this function
in root's .zshrc:
function add-dir {
which=$1
shift
foreach dir ($*) {
eval $which=(\${$which} \$dir)
}
}
This used to work in 3.0.x, but now that I've installed 4.0.4, it fails with
add-dir:4: unknown file attribute
Why isn't the space inside the parens enough to keep them from being treated
as a glob qualifier? It used to be.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Unexpected "unknown file attribute" error
2001-11-09 1:22 Unexpected "unknown file attribute" error Bart Schaefer
@ 2001-11-12 12:28 ` Peter Stephenson
0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2001-11-12 12:28 UTC (permalink / raw)
To: Zsh hackers list
Bart Schaefer wrote:
> For obscure reasons, one of the machines I use at work has this function
> in root's .zshrc:
>
> function add-dir {
> which=$1
> shift
> foreach dir ($*) {
> eval $which=(\${$which} \$dir)
> }
> }
>
> This used to work in 3.0.x, but now that I've installed 4.0.4, it fails with
>
> add-dir:4: unknown file attribute
>
> Why isn't the space inside the parens enough to keep them from being treated
> as a glob qualifier? It used to be.
I think the change is in haswilds() --- so it affects whether globbing
takes place at all, not just qualifiers. It used to check whether there
were balanced parentheses with interesting-looking characters inside; now
it is triggered just by an open parenthesis.
The change is beyond the reach of CVS, but it may have changed to support
patterns like `foo|bar' in case statements --- they used to get wrapped by
an extra layer of parentheses, but now don't; simplifying the code may
have seemed the easiest bet.
Apart from the annoyance of the incompatibility, I don't see why unquoted
parentheses shouldn't trigger globbing, though --- it saves a lot of rather
picky tests which are hard to keep in line with the main globbing code.
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK Tel: +44 (0)1223 392070
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-11-12 12:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-09 1:22 Unexpected "unknown file attribute" error Bart Schaefer
2001-11-12 12:28 ` Peter Stephenson
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).