1 # Export PROFILE_HOME to the environment if we need to preserve it.
2 if [ -n "$PROFILE_HOME" ]; then
3 [ "$PROFILE_HOME" = "$HOME" ] || export PROFILE_HOME
6 # Find a path, preferring the target user's version.
7 function find_target_profile() {
10 for dir in $HOME $PROFILE_HOME; do
11 if [ -e "$dir/$path" ]; then
20 # Find a path, preferring the source user's version.
21 function find_source_profile() {
22 local path="$1"; shift
24 for dir in $PROFILE_HOME $HOME; do
25 if [ -e "$dir/$path" ]; then