shopt failglob If set, patterns which fail to match filenames during pathname expansion result in an expansion error. Using this feature is good practice in scripts as helps prevent scripting mistakes; however, having file name with square brackets causes failures. And with Fedora 40 upgrade seems google-noto-sans-mono-vf-fonts-20240301-2.fc40.noarch has added one with: /usr/share/fonts/google-noto-vf/NotoSansMono[wght].ttf Reproducible: Always Steps to Reproduce: 1. Causes globs that don't expand to cause errors $ shopt -s failglob 2. Try use files from rpm as variable, and fail $ for file in $(rpm -q --list google-noto-sans-mono-vf-fonts) ; do [[ -f "/${file}" ]] || echo "${file}" done -bash: no match: /usr/share/fonts/google-noto-vf/NotoSansMono[wght].ttf 3. Note the RC $ echo $? 1 4. Or even command line $ rpm -qf /usr/share/fonts/google-noto-vf/NotoSansMono[wght].ttf -bash: no match: /usr/share/fonts/google-noto-vf/NotoSansMono[wght].ttf $ rpm -qf '/usr/share/fonts/google-noto-vf/NotoSansMono[wght].ttf' google-noto-sans-mono-vf-fonts-20240301-2.fc40.noarch Actual Results: -bash: no match: /usr/share/fonts/google-noto-vf/NotoSansMono[wght].ttf Expected Results: no error accessing files with failglob shopt enabled started fedora 40 upgrade, as daily script of mine fails because this file is included in initramfs too.
FYI google-noto-sans-mono-vf-fonts is installed for me as a vlc dependency
There should be no limitations in characters to be used for filename. That sounds to me like a script bug. shouldn't they try to escape such characters? FWIW this isn't new. it was there since f38.
Sorry. And the RPM was on my system in F39. However, it must not have been getting included in initramfs until F40. My script is looking at lsinitrd -k output, and hitting this issue.
Agree, can work around the issue. Not a problem. Wanted to report it, as could be other backup applications that could have issue. Feel free to close not a bug.
I think it would make sense to raise this with upstream: it is highly unusual to have brackets in system filenames. I always thought it looked strange too.