From 37eec285330d0072c8095e64631b4ad8f0c92d26 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 13 Jan 2023 18:26:25 +0300 Subject: [PATCH] .shellrc: Move bash-only code to `.bashrc` --- .bashrc | 8 ++++++++ .shellrc | 10 ---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.bashrc b/.bashrc index 3255cb6..f516a37 100644 --- a/.bashrc +++ b/.bashrc @@ -53,6 +53,14 @@ back() { cd - "$@"; } functions() { typeset -f "$@"; } j() { jobs; } +if [ -r "$HOME"/admin/prog/bash_prompt ]; then + . "$HOME"/admin/prog/bash_prompt + set_prompt + unset set_prompt +else + PS1="${debian_chroot:+($debian_chroot)}\u@\h:\W \$SHLVL\\$ " +fi + if [ -z "$BASH_COMPLETION_COMPAT_DIR" ]; then if [ -d /usr/share/bash-completion -a -r /usr/share/bash-completion/bash_completion ]; then _BASH_COMPLETIONS_DIR=/usr/share/bash-completion/completions diff --git a/.shellrc b/.shellrc index 944d2f6..e3a0ac7 100644 --- a/.shellrc +++ b/.shellrc @@ -44,16 +44,6 @@ if test -n "$KSH_VERSION" -o -n "$FCEDIT"; then j() { jobs; } fi -if test -n "$BASH_VERSION"; then - if [ -r "$HOME"/admin/prog/bash_prompt ]; then - . "$HOME"/admin/prog/bash_prompt - set_prompt - unset set_prompt - else - PS1="${debian_chroot:+($debian_chroot)}\u@\h:\W \$SHLVL\\$ " - fi -fi - # clear screen and history, logout chlo() { clear; cd; >$HISTFILE; unset HISTFILE; history -c; logout || exit; } -- 2.39.2