dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 4eaee0b9ab534641cf9260ea63b01b3e54bc90b1
parent 7bfbb027d04bf4fee7ab0a496aa2cf06cea8fd7d
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Fri, 18 Sep 2020 12:16:51 +0200

.kshrc: generalize PS1 assignment

Diffstat:
M.kshrc | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/.kshrc b/.kshrc @@ -5,8 +5,10 @@ HISTSIZE=50000 set -o vi -PS1="\u@\h:\w \${?#0}\\$ " -if [ "$(uname)" = "Linux" ]; then - PS1="$USER@${HOSTNAME:=$(hostname)}:\${PWD/\/home\/$USER/\~} \\$ " -fi +case "$0" in +*ksh) + PS1='\u@\h:\w ${?#0}$ ';; +*sh) + PS1='${USER}@${HOSTNAME:=$(hostname)}:${PWD} ${?#0}$ ';; +esac export PS1