2
So I've made a small script to search through my project for a word:
#!/bin/bash
grep -n $1 js/*/**.js
grep -n $1 js/*.js
When running these commands in the command line I will get some nice syntax highlighting. But when I run them in a script I loose the colors. How can avoid this?
Hmm, I modified this and set
export GREP_OPTIONS=--color
in the beginning of the script; which works. This may be preferable to Bernhard's solution for larger scripts. – worldsayshi – 2012-12-21T09:18:46.913