dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

Color-always on grep breaks CircleCI (and possibly other bash scripts)

Open sdspikes opened this issue 8 years ago • 1 comments

https://github.com/supertopher/dotfiles/blob/93a2e91931f96b5bbd7b4e3c6a76c6273eea55f9/.bash_profile#L75

If you have a bash script (like CircleCI's CLI: https://circle-downloads.s3.amazonaws.com/releases/build_agent_wrapper/circleci) that redirects the grep output into a file, you get escape characters for the coloring in the file, which in this case, broke the script in a very non-obvious way.

sdspikes avatar Oct 16 '17 22:10 sdspikes

I ran into this today. Here's a fix that lets you still have colors:

export GREP_OPTIONS='--color=auto'

This won't output the color character if in a non-interactive environment.

vcolavin avatar Jun 27 '18 23:06 vcolavin