Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

ksh93: shell quoting within glob bracket patterns has no effect #71

@McDutchie

Description

@McDutchie

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.]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions