]> git.phdru.name Git - dotfiles.git/commitdiff
bash: Cut long hostname to 5 characters
authorOleg Broytman <phd@phdru.name>
Mon, 8 Jun 2020 17:48:03 +0000 (20:48 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 8 Jun 2020 17:48:03 +0000 (20:48 +0300)
.profile
.shellrc

index 2cfb9431d9ad69cb6251fd751ebad263467f4035..07d4f98ced6178296619baaf9824deb83aebf034 100644 (file)
--- 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
index 541417a422ae2ff1c5040e1e58c70f74b8867034..6cb771f2d0824c3f32514a33b3bbdaf8bd2ba7fa 100644 (file)
--- 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