#!/bin/bash

if [ -f /etc/profile ]; then
   source /etc/profile > /dev/null
fi

if [ -f ~/.bash_profile ]; then
   source ~/.bash_profile > /dev/null
fi

if [ -f ~/.bash_login ]; then
   source ~/.bash_login > /dev/null
fi

if [ -f ~/.profile ]; then
   source ~/.profile > /dev/null
fi

#!/bin/bash

if [ -f /etc/profile ]; then
   source /etc/profile > /dev/null
fi

if [ -f ~/.bash_profile ]; then
   source ~/.bash_profile > /dev/null
elif [ -f ~/.bash_login ]; then
   source ~/.bash_login > /dev/null
elif [ -f ~/.profile ]; then
   source ~/.profile > /dev/null
fi

Change sourcing scripts to mimic Bash more closely
Change sourcing scripts to mimic Bash more closely

Summary:
Always load /etc/profile and then pick one of .bash_profile, .bash_login, and .profile.

See http://superuser.com/a/357175/54080

Test Plan: Ran both scripts and didn't get an error.

Reviewers: jesse

Differential Revision: D3020

fbshipit-source-id: 3f4045a
