On 05/03/2024 11:36, Max Nikulin wrote:
On 05/03/2024 09:02, Greg Wooledge wrote:
On Tue, Mar 05, 2024 at 10:49:34AM +0900, John Crawley wrote:
I think ^ has been deprecated recently. I failed to find a reference on the web
just now though.
So, ^ isn't "deprecated". It's just not portable to sh.
Running shellcheck on a *sh* script with a [^s] glob gives
https://www.shellcheck.net/wiki/SC3026
"In POSIX sh, ^ in place of ! in glob bracket expressions is undefined."
with some links. There is no warning in the case of a #!/bin/bash script.
Thanks! Shellcheck also says:
"Dash used to support [^c] when compiled with fnmatch and glob from glibc, but it
was considered as a bug and fixed in version 0.5.12."
That's the version of dash which arrived in Debian Bookworm.
--
John