GNU bug report logs -
#19998
GREP_OPTIONS alternative?
Previous Next
Full log
View this message in rfc822 format
On Fri, 6 Mar 2015 at 00:29, Norihiro Tanaka wrote:
> Please think to use grep -F and grep -E instead of fgrep and egrep.
> For others, you can use following script, or customize grep's source
> code and rebuild it to change default.
OK, that (and the bits below) seem to confirm that there's no simple
alternative to GREP_OPTIONS and one has to make serious changes to mimic
that behaviour. Oh well...
Thanks for your input though.
Christian.
>
> --
> mv /bin/grep /bin/grep.bin
> cat <<EOF >/bin/grep
> #! /bin/sh
> exec /bin/grep.bin --color=auto --devices=skip "$@"
> EOF
> chmod a+x /bin/grep
> --
>
>
> --
> diff -ru grep-2.21.orig/src/grep.c grep-2.21/src/grep.c
> --- grep-2.21.orig/src/grep.c 2014-11-09 19:00:37.000000000 +0000
> +++ grep-2.21/src/grep.c 2015-03-05 15:26:59.000000000 +0000
> @@ -72,7 +72,7 @@
> static bool suppress_errors;
>
> /* If nonzero, use color markers. */
> -static int color_option;
> +static int color_option = 2;
>
> /* Show only the part of a line matching the expression. */
> static bool only_matching;
> @@ -391,7 +391,7 @@
> READ_COMMAND_LINE_DEVICES,
> READ_DEVICES,
> SKIP_DEVICES
> - } devices = READ_COMMAND_LINE_DEVICES;
> + } devices = SKIP_DEVICES;
>
> static bool grepfile (int, char const *, bool, bool);
> static bool grepdesc (int, bool);
> --
>
>
--
BOFH excuse #119:
evil hackers from Serbia.
This bug report was last modified 10 years and 133 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.