From d0da7aa3139797d29a7de91e4491c52a6004ac20 Mon Sep 17 00:00:00 2001 From: Don Harper Date: Wed, 11 Dec 2024 11:07:22 -0600 Subject: [PATCH] task | move interactive stuff to the PS1 block --- home/common/files/bash/bashrc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/home/common/files/bash/bashrc b/home/common/files/bash/bashrc index a248f53..769e80a 100755 --- a/home/common/files/bash/bashrc +++ b/home/common/files/bash/bashrc @@ -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"