if [ ${_ETC_PROFILE_:=0} = 0 ]; then export _ETC_PROFILE_=1 if [ $(env | grep ';' | wc -c) -ne 0 ]; then echo "Fixing env" # Add 'UNIX' executable directories and remove windows ones PATH="/usr/local/bin:/bin:/usr/bin:/bin:$PATH" PATH=`echo "$PATH" | sed -e 's,:/perl5.004.bc/bin,,;s,:/wbin,,g'` # Convert DOS backslashes, drives, and path separators in environment to UNIX # 1. Don't touch PATH # 2. Don't lines starting with punctuation !_@#%^&*()=+:;<>?/`~- # 3. Backslash -> slash # 4. C:/ -> / and C: -> / # 5. DRIVE: -> /DRIVE # 6. ; -> : # 7. Quote values tfile=/tmp/profile.$$ env | \ sed -e '/^$/d;/^PATH=/d' \ -e '/^[!_@#%^&*()=+:;<>?/`~-]/d' \ -e 's,\\,/,g' \ -e 's,[Cc]:/,/,g' -e 's,[Cc]:,/,g' \ -e 's,\([a-zA-Z]\):,//\1/,g' \ -e 's,;,:,g' \ -e "s/^\([^=][^=]*=\)\(.*\)$/\1'\2'/" > $tfile source $tfile rm $tfile fi # Other shell initialization stuff export TERM=linux set -o vi fi