- # Ensure that grep's -f and -E options works.
- # On Solaris 5.11, "grep -f" prints this:
- # grep: illegal option -- f
- # Usage: grep -hblcnsviw pattern file . . .
- # Similar for grep -E.
-
- : | grep -f /dev/null
- test $? = 1 || skip_ 'your grep lacks support for -f -'
-
- grep -E foo /dev/null
- test $? = 1 || skip_ 'your grep lacks support for -E'
+ local octal_fmt=$(printf '\\%o' \
+ $(printf '%s\n' "$1" \
+ | sed 's,\\x\([0-9abcdefABCDEF][0-9abcdefABCDEF]\), 0x\1,g'))
+ printf "$octal_fmt"