sed command does not behave equal from 10.3 to 11.0

José García Juanino jjuanino at gmail.com
Wed Jul 27 08:20:14 UTC 2016


Hi FreeBSD stable,

After upgrade to 11.0-BETA2, a lot of sed scripts are no longer valid:

FreeBSD 10.3
---------------------
$ echo "abc_ABC.def" | sed -e 's/[^A-Z0-9]//g'
ABC


FreeBSD 11.0
--------------------
$ echo "abc_ABC.def" | sed -e 's/[^A-Z0-9]//g'
bcABCdef


Indeed, in 11.0 you need to re rewrite the sentence as follows:

$ echo "abc_ABC.def" | sed -e 's/[^[:upper:][:digit:]]//g'
ABC

In linux, sed behaves exactly as 10.3.

Is this behaviour expected or is a bug?

Best regards


More information about the freebsd-stable mailing list