0

zsh: 4.3.17
GNU bash: 4.2.24
GNU grep: 2.10

I would like to know what I did wrong in the grep part -> why grep doesn't highlight the results when used inside the .zshrc file, actually it doesn't output something at all.
When not using a variable or a .rc file (testing the cmd on the cli), grep works like expected.

function seek() { clear; echo $1; locate -ie "$PWD${1}" | grep "${1}"; }
Paradiesstaub
  • 2,590
  • 2
  • 18
  • 28

1 Answers1

0

Is $GREP_COLORS set early enough in the .rc file? Also, you can try grep --color=always if you are piping the output of grep through something.

choroba
  • 231,213
  • 25
  • 204
  • 289
  • The weird thing is that there is no output at all. When replacing `${1}` in the .rc file with `[my search pattern]` (hard coding) everything works fine. – Paradiesstaub Nov 22 '12 at 00:18