Warning from grep
I use several aliases that use grep, for example:
Code:
alias lsgp="ls /var/log/packages | grep $1" Code:
$ lsgp zsh Regards, Bill |
Hi.
Seems you're setting GREP_OPTIONS somewhere (.bashrc/.bash_profile/.zshrc, etc.) and grep is letting you know it is deprecating this. You can check with: Code:
$ export | grep GREP grep show the matched strings in color you can do something like: Code:
$ alias lsgp="ls /var/log/packages | grep --color=auto $1" Code:
$ alias lsgp="ls /var/log/packages | grep $1 2>/dev/null" |
Thanks, mancha. With your tip, I found I was setting the GREP-OPTIONS in my bashrc. I was able to modify my aliases to get the same results & eliminate the GREP-OPTIONS line.
Regards, Bill |
put the cookies on the bottom shelf!
When I run the suggested command:
Code:
export | grep GREP Code:
declare -x GREP_OPTIONS="--color" unset GREP_OPTIONS and run the first command again, there are no results. The missing step for me is how to find out where the "declare -x" statement is originating from. How do you find what is setting the GREP_OPTIONS env. variable in the first place? |
In my case, I think GREP_OPTIONS was being set in /etc/profile.d/coreutils-dircolors.sh. I modified my alias to the first form listed by mancha & it works perfectly. For other ls aliases, I used the LS_OPTIONS env. var., as in:
Quote:
Regards, Bill |
All times are GMT -5. The time now is 09:11 AM. |