Add user .bashrc and .bash_profile files and slightly modified the system bashrc
This commit is contained in:
+5
-4
@@ -1,6 +1,7 @@
|
||||
# /etc/bashrc
|
||||
|
||||
# Setting bash prompt if not in chroot
|
||||
if ! [ "$(awk '$5=="/" {print $1}' </proc/1/mountinfo)" != "$(awk '$5=="/" {print $1}' </proc/$$/mountinfo)" ]; then
|
||||
PS1='[\u@\h \W]\$ '
|
||||
fi
|
||||
# Return if not running interactively
|
||||
[[ $- == *i* ]] || return
|
||||
|
||||
# Set bash prompt
|
||||
PS1='[\u@\h \W]\$ '
|
||||
|
||||
@@ -22,17 +22,17 @@ if [ -f /etc/locale.conf ]; then
|
||||
set +a
|
||||
fi
|
||||
|
||||
# Source scripts in profile.d
|
||||
if [ -d /etc/profile.d ]; then
|
||||
for f in /etc/profile.d/*.sh; do
|
||||
[ -r "$f" ] && source "$f"
|
||||
[ -r "$f" ] && . "$f"
|
||||
done
|
||||
fi
|
||||
|
||||
# Unsetting functions
|
||||
unset -f append_path
|
||||
|
||||
# Run /etc/bashrc if in an interactive terminal
|
||||
if [[ $- == *i* ]]; then
|
||||
. /etc/bashrc
|
||||
# Run /etc/bashrc if running in a non-posix-compliant bash shell and if the file exists
|
||||
if [ -f /etc/bashrc ] && [ -n "$BASH" ] && [ -z "$POSIXLY_CORRECT"]; then
|
||||
. /etc/bashrc
|
||||
fi
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# ~/.bash_profile
|
||||
|
||||
# Source user .bashrc if it exists
|
||||
[ -f $HOME/.bashrc ] && source $HOME/.bashrc
|
||||
@@ -0,0 +1,7 @@
|
||||
# ~/.bashrc
|
||||
|
||||
# Return if not running interactively
|
||||
[[ $- == *i* ]] || return
|
||||
|
||||
# Set bash prompt
|
||||
PS1='[\u@\h \W]\$ '
|
||||
Reference in New Issue
Block a user