haiku/data/etc/profile
Oscar Lesta 3761b2f420 etc/profile: locale settings might have changed since SetupEnvironment.
Before this, changing the locale settings via Locale preflet required
a reboot in order for the changes to get picked up by programs running
on Terminal.

Fixes: #18734

Change-Id: I149931c511020f9eb881e71f79d1fd6c647477e2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7792
Reviewed-by: nephele nephele <nep-git@packageloss.eu>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-07-18 09:23:27 +00:00

79 lines
1.5 KiB
Bash

#
# Administrative startup for /bin/sh
# Place user customizations in ~/config/settings/profile
#
_ARCH=`getarch 2>/dev/null`
if [ "$_ARCH" = "`getarch -p 2>/dev/null`" ] ; then
echo -e "\nWelcome to the Haiku shell.\n"
PS1="\w"
else
echo -e "\nSwitching to architecture `getarch`\n"
PS1="[$_ARCH] \w"
fi
unset _ARCH
export PS1="\["'`if [ $? = 0 ]; then echo "\e[32m";
else echo "\e[31m"; fi`'"\]$PS1\[\e[0m\]> "
export USER=`id -un`
export GROUP=`id -gn`
if [ -z $BE_HOST_CPU ]; then
. /boot/system/boot/SetupEnvironment
fi
export HISTFILESIZE=500
export HISTCONTROL=ignoredups
alias ls="ls --color=auto"
alias ll="ls -lA"
alias la="ls -A"
alias m="more"
test -n "$BASH_VERSION" && shopt -s checkwinsize
if test -n "$KSH_VERSION"; then
ps1_pwd() {
local e=$? d=${PWD:-?}/ p=~
[[ $p = ?(*/) ]] || d=${d/#$p\//\~/}
print -nr -- "${d%/}"
return $e
}
PS1=${PS1/'\w'/'$(ps1_pwd)'}
else
test -n "$BASH_VERSION" || PS1=$(printf '%s' "$PS1" | \
sed 's/\\w/$PWD/')
fi
function dir {
ls -lF "$@";
}
for dir in `findpaths -Re B_FIND_PATH_DATA_DIRECTORY profile.d 2> /dev/null`; do
for i in $dir/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
done
unset dir
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
# Locale
export LC_MESSAGES=`locale --message`
export LC_NUMERIC=`locale --format`
export LC_TIME=`locale --time`
export LC_COLLATE=$LC_MESSAGES
export LC_CTYPE=$LC_MESSAGES
export LC_MONETARY=$LC_NUMERIC