0

Everyone write if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi into .bashrc etc after installation of pyenv.

I know if I didn't excute eval "$(pyenv init -)", python's version would not change.

Why do I need to write if which pyenv > /dev/null? What's it mean? What would happen without it?

Thanks.

hrsma2i
  • 4,045
  • 6
  • 15
  • 24
  • This question is mistagged. As all your questions have to do with bash, the `bash` tag is missing. – Jdamian May 06 '17 at 13:34

1 Answers1

2

It is used to check if pyenv is found, but suppress the output of the which command.

Without it, the output of which would print to the console, every time .bashrc is sourced.

Dean Fenster
  • 2,345
  • 1
  • 18
  • 27