You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 16, 2025. It is now read-only.
This bug means the - retains it special meaning of 'character range', and an initial ! (or ^) retains the meaning of negation, even in quoted strings within bracket patterns, including quoted variables.
for var in 'a-c' '!a'; do
case b in
( ["$var"] ) echo 'bug' ;;
( [$var] ) echo 'no bug' ;;
esac
done
Output: bug (twice)
[Is this actually a bug, or just a quirk/minority behaviour? ksh93, older zsh, and bosh (schilytools Bourne shell) are the only ones to act this way, but I can't find a relevant POSIX text now. But in any case, quoting * and ? in case glob patterns always works to disable their behaviour as wildcards, so it seems inconsistent at best for the same sort of quoting to be ignored in glob bracket patterns.]
This bug means the - retains it special meaning of 'character range', and an initial ! (or ^) retains the meaning of negation, even in quoted strings within bracket patterns, including quoted variables.
Output:
bug(twice)[Is this actually a bug, or just a quirk/minority behaviour? ksh93, older zsh, and bosh (schilytools Bourne shell) are the only ones to act this way, but I can't find a relevant POSIX text now. But in any case, quoting
*and?incaseglob patterns always works to disable their behaviour as wildcards, so it seems inconsistent at best for the same sort of quoting to be ignored in glob bracket patterns.]