mathiasbynens / dotfiles

:wrench: .files, including ~/.macos — sensible hacker defaults for macOS
https://mths.be/dotfiles
MIT License
30.35k stars 8.73k forks source link

errors in linux #497

Open tejasmanohar opened 9 years ago

tejasmanohar commented 9 years ago

following errors print at beginning of every shell in my new arch linux setup

which: no brew in (/home/tejas/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script

the brew one is obvious, the other two i'm not sure how to fix. as per the brew one, i think it'd be a good idea to add a check if we're on OS X in the script before looking for brew.

thoughts on this and how to fix other 2 errors?

mklishevych commented 9 years ago

I believe the first one comes from here: https://github.com/mathiasbynens/dotfiles/blob/master/.bash_profile#L29

which ... > /dev/null

This doesn't mute the output of bash's which command. I believe the fix would be to change that to next (2> /dev/null instead of > /dev/null):

if which brew 2> /dev/null && [ -f "$(brew --prefix)/etc/bash_completion" ]; then

Regarding grep error, you can comment out GREP_OPTIONS variable assignment here: https://github.com/mathiasbynens/dotfiles/blob/master/.exports#L21

If you still want to use grep coloring everywhere, you can just add an alias to .aliases file which would look like this:

alias grep='grep --color=auto'
tejasmanohar commented 9 years ago

ah, thanks! i have no more errors on top of shell but there's a blank line now O.o

https://github.com/tejasmanohar/dotfiles

tejasmanohar commented 9 years ago

@mklishevych

https://github.com/tejasmanohar/dotfiles

at the start of every terminal in OS X (and linux), i get an empty new line.

also i changed it back to the original > /dev/null instead of 2> /dev/null unlike how you suggested because on my mac it keeps printing out the location of brew like /usr/local/brew or something. is there any way my dotfiles can work in harmony across the two OS?