I am installing Ruby on Rails on Mac OS X. The tutorial I am following says to add:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
to ~/.bash_profile.
What does this line do?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
[[ -s "$HOME/.rvm/scripts/rvm" ]]This portion is a test condition (
[[is the new test command).-sreturnsTRUEif the filervmpresent over at$HOME/.rvm/scripts/locationexists and is of size greater than zero.&&This is a logical
andoperator. It executes the statement on the right IF AND ONLY IF statement on the left returns true.. "$HOME/.rvm/scripts/rvm".is short forsourcecommand. You are sourcing the file in your current shell and not forking a new sub-shell