Quote:
Originally Posted by
cfajohnson
That is not POSIX and not portable.
Are you saying that the syntax of
[!...
] as described in the
Filename Expansion section of the Bash manual is not POSIX and not portable?
Or do you just mean that Bash in general is not POSIX and not portable?
Oh! I just found a document from the OpenGroup that describes
Pattern Matching Notation which says,
A bracket expression starting with an unquoted <circumflex> character produces unspecified results. Great! A built-in gotcha.
It is true that Bash has extensions beyond POSIX, and therefore if something works perfectly in the Bash shell, there is no guarantee it will work in some other shell. For that reason there is wisdom in insisting on POSIX compatibility as you do.
But one has to consider the context in which one codes. Many scripts will never be used outside of Bash, or even be seen by someone who holds Bash extensions in other than the highest regard. If one writes a Perl or Python script, it's not wrong to require that it only be run on systems with Perl or Python installed. I don't think it's out of order to view Bash scripts similarly.