From 010b07f108be94c48aa69a7ca7547a4f8e12ea9d Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 8 Jun 2020 20:48:03 +0300 Subject: [PATCH] bash: Cut long hostname to 5 characters --- .profile | 2 +- .shellrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.5