From: Oleg Broytman Date: Mon, 8 Jun 2020 17:48:03 +0000 (+0300) Subject: bash: Cut long hostname to 5 characters X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=commitdiff_plain;h=010b07f108be94c48aa69a7ca7547a4f8e12ea9d bash: Cut long hostname to 5 characters --- diff --git a/.profile b/.profile index 2cfb943..07d4f98 100644 --- a/.profile +++ b/.profile @@ -194,7 +194,7 @@ if [ -t 0 ] ; then if [ -r "$HOME"/admin/prog/short_curdir ]; then . "$HOME"/admin/prog/short_curdir - OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\h \`short_curdir\` \\$" + OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\${HOSTNAME::5} \`short_curdir\` \\$" else OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\h \W \\$" fi diff --git a/.shellrc b/.shellrc index 541417a..6cb771f 100644 --- a/.shellrc +++ b/.shellrc @@ -342,7 +342,7 @@ mc() { if test -n "$BASH_VERSION"; then MC_SAVE_OPS1="$OPS1" if [ "`type -t short_curdir`" = function ]; then - OPS1="\u@\h \`short_curdir\` \\$" + OPS1="\u@\${HOSTNAME::5} \`short_curdir\` \\$" else OPS1="\u@\h \W \\$" fi