task | move interactive stuff to the PS1 block
This commit is contained in:
parent
7d8ab20244
commit
d0da7aa313
1 changed files with 9 additions and 10 deletions
|
|
@ -41,20 +41,12 @@ do
|
|||
HOSTNAME_SHORT=$(hostnamectl | awk -F: '$1=/Static hostname/{print $2}' | sed 's/^ //')
|
||||
done
|
||||
export HOSTNAME_SHORT
|
||||
HISTNAME=$LOGNAME
|
||||
if [ $EUID == 0 ];then HISTNAME=root;fi
|
||||
HISTFILE="${HOME}/.bash_history.${HISTNAME}.${HOSTNAME_SHORT}.$(tty|cut -c10-)"
|
||||
export HISTFILE
|
||||
test -f "${HOME}/.bash_ssh" && source "${HOME}/.bash_ssh"
|
||||
|
||||
|
||||
# set coredump size to 0
|
||||
ulimit -c 0
|
||||
|
||||
umask 0007
|
||||
if [ "$LOGNAME" ]; then
|
||||
USER=$LOGNAME
|
||||
fi
|
||||
|
||||
OS_SYS=$(uname -s)
|
||||
OS_REL=$(uname -r)
|
||||
|
|
@ -78,8 +70,6 @@ test -d /usr/bin && PATH="${PATH}:/usr/bin"
|
|||
test -d /bin && PATH="${PATH}:/bin"
|
||||
export PATH
|
||||
|
||||
test -f "${HOME}/.bash_ssh" && . ${HOME}/.bash_ssh
|
||||
|
||||
#interactive login ?
|
||||
|
||||
#####################################
|
||||
|
|
@ -104,6 +94,15 @@ then
|
|||
shopt -s histappend
|
||||
shopt -s histreedit
|
||||
|
||||
if [ "$LOGNAME" ]; then
|
||||
USER=$LOGNAME
|
||||
fi
|
||||
HISTNAME=$LOGNAME
|
||||
if [ $EUID == 0 ];then HISTNAME=root;fi
|
||||
HISTFILE="${HOME}/.bash_history.${HISTNAME}.${HOSTNAME_SHORT}.$(tty|cut -c10-)"
|
||||
export HISTFILE
|
||||
test -f "${HOME}/.bash_ssh" && source "${HOME}/.bash_ssh"
|
||||
|
||||
PAGER=less
|
||||
LESS="-Rs"
|
||||
EXINIT="set wrapmargin=8 sh=$SHELL sw=4 report=2 tabstop=8"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue