Adam Endrodi schreef op 02-03-16 om 22:09:
> The following program prints "boo" incorrectly (I'm trying to match
> non-numbers):

That's correct. In shell glob pattern bracket expressions, the standard
negator is '!' and not '^'. Many shells support '^' as a synonym, but
that's an extension to the standard and not mandatory. Dash usually
doesn't support such extensions. But all shells support '!', so just
that instead and you're safe.

Reference:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13
"If an open bracket introduces a bracket expression as in XBD RE Bracket
Expression, except that the <exclamation-mark> character ( '!' ) shall
replace the <circumflex> character ( '^' ) in its role in a non-matching
list in the regular expression notation, it shall introduce a pattern
bracket expression."

- M.

--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to