Sophie

Sophie

distrib > Mageia > 5 > x86_64 > by-pkgid > 8532bae41cb359176f1887e9d9f24d87 > files > 4

bash-4.3-33.1.mga5.x86_64.rpm

# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

# It's NOT good idea to change this file unless you know what you
# are doing. Much better way is to create custom.sh shell script in
# /etc/profile.d/ to make custom changes to environment. This will
# prevent need for merging in future updates.

# By default, we want this to get set.
# Even for non-interactive, non-login shells.
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
	umask 002
else
	umask 022
fi

# are we an interactive shell?
if [ "$PS1" ]; then
    case $TERM in
	xterm*)
        # Inelegant fix for MGA #1623.
        PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:$(perl -le '\''use Cwd; print Cwd::getcwd() =~ s#\A\Q$ENV{HOME}\E(?=/|\z)#~#r'\'')"; echo -ne "\007"'
	    ;;
	screen)
	    PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:$(perl -le '\''use Cwd; print Cwd::getcwd() =~ s#\A\Q$ENV{HOME}\E(?=/|\z)#~#r'\'')"; echo -ne "\033\\"'
	    ;;
	*)
	    ;;
    esac
    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
    # You might want to have e.g. tty in prompt (e.g. more virtual machines)
    # and console windows
    # If you want to do so, just add e.g.
    # if [ "$PS1" ]; then
    #   PS1="[\u@\h:\l \W]\\$ "
    # fi
    # to your custom modification shell script in /etc/profile.d/ directory
    
    if [ -z "$loginsh" ]; then # We're not a login shell
	# Not all scripts in profile.d are compatible with other shells
	# TODO: make the scripts compatible or check the running shell by
	# themselves.
	if [ -n "${BASH_VERSION}${KSH_VERSION}${ZSH_VERSION}" ]; then
            for i in /etc/profile.d/*.sh; do
	        if [ -r $i ]; then
	            . $i
	        fi
	    done
	    unset i
	fi
    fi
fi

unset loginsh