3 ms·
Important note: not actually compatible. It took me seconds to find an option that does something completely different than the GNU version.
by o11c 3y ago
Important note: not actually compatible. It took me seconds to find an option that does something completely different than the GNU version.
- fwip 3y agoWhich option is that? I'm scanning the ugrep page, but nothing is popping out to me.
- e12e 3y agoI would assume compatible meant posix/bsd - unless explicitly advertised AS "GNU grep compatible"?
- burntsushi 3y agoFrom the OP: "Ugrep is compatible with GNU grep and supports GNU grep command-line options."
- burntsushi 3y agoIndeed. And here are some concrete examples around locale: $ grep -V | head -n1 grep (GNU grep) 3.11 $ alias ugrep-grep="ugrep-4.4.1 -G -U -Y -. --sort -Dread -dread" $ echo 'pokémon' | LC_ALL=en_US.UTF-8 grep 'pok[[=e=]]mon' pokémon $ echo 'pokémon' | LC_ALL=en_US.UTF-8 ugrep-grep 'pok[[=e=]]mon' $ echo 'γ' | LC_ALL=en_US.UTF-8 grep -i 'Γ' γ $ echo 'γ' | LC_ALL=en_US.UTF-8 ugrep-grep -i 'Γ' BSD grep works like GNU grep too: $ grep -V grep (BSD grep, GNU compatible) 2.6.0-FreeBSD $ echo 'pokémon' | LC_ALL=en_US.UTF-8 grep 'pok[[=e=]]mon' pokémon $ echo 'γ' | LC_ALL=en_US.UTF-8 grep -i 'Γ' γ