[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Failglob issues
From: |
Nikolai Kondrashov |
Subject: |
Failglob issues |
Date: |
Sun, 01 Sep 2013 12:45:23 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 |
Hi everyone,
I'm trying to use "failglob" option in several projects of mine and noticed
the following strange behavior.
1) With both nullglob and failglob enabled it is considered an error for a
glob not to match anything. I'd say it's more natural to not produce an
error in this case. Otherwise a fairly useful behavior is broken, like
glob use in "for" loop:
shopt -s nullglob failglob
for file in *.rpm; do
# Do something with the file
done
Am I missing some other, more important consideration here? If there is
none, could this be considered a bug and fixed?
2) Unquoted globs in associative array initializers with failglob enabled
produce an error, although the documentation doesn't mention any use of
globs there and with failglob disabled globs don't seem to expand to
anything. I.e. this fails:
shopt -s failglob
declare -A A=([a]=*)
Are globs supposed to have an effect in associative array initializers? If
yes, what effect, and should this be documented? If not, is it possible
that this is a bug and the above shouldn't fail?
Thank you.
Sincerely,
Nick
- Failglob issues,
Nikolai Kondrashov <=