3 ms·
Does that part of the build system then need to explicitly unset CLICOLOR_FORCE and MAKE_TERMOUT Yes, it should be the responsibility of the build system to co
by racer-v 9y ago
Does that part of the build system then need to explicitly unset CLICOLOR_FORCE and MAKE_TERMOUT
Yes, it should be the responsibility of the build system to control the environment variables set during the build.
What would happen if a build system set one of those, and then somewhere deep in the build system (or even in a shell script called from the build system), someone ran grep in a pipeline
The person adding the 'grep' would need to be aware of whether the build system is using color output or not.
This is also part of why programs like grep are removing environment variables like GREP_OPTIONS: they break scripts.
This seems unfortunate; scripts could just unset GREP_OPTIONS if they care.
- JoshTriplett 9y ago> This seems unfortunate; scripts could just unset GREP_OPTIONS if they care. grep is portable, and much older than GREP_OPTIONS. A script shouldn't be expected to fix any random non-standard idiosyncrasy of the local version of grep.
- racer-v 9y agoFair enough; since GREP_OPTIONS seems only useful for interactive sessions, perhaps non-interactive shells should purge it from the environment (e.g. with BASH_ENV). It would be great if grep could figure out whether its parent process is an interactive shell or a script, but there doesn't seem to be a reliable way to do that.