1
0
mirror of https://github.com/meineerde/dotfiles.git synced 2025-10-17 19:41:01 +00:00

Fix stupid string handling bug

This commit is contained in:
Holger Just 2011-07-22 11:01:12 +02:00
parent 1d0967f754
commit 9bf39f0c57

View File

@ -179,7 +179,7 @@ PS1="${debian_chroot:+($debian_chroot)}"
# Short PWD, if it's to long.
short_pwd() {
FIXED_PWD="${PWD/#$HOME/~}"
if [[ ${#FIXED_PWD} -gt ${#PWD_LENGTH} ]]; then
if [[ ${#FIXED_PWD} -gt $PWD_LENGTH ]]; then
echo "${FIXED_PWD:0:$((4))}...${FIXED_PWD:$((${#PWD}-$PWD_LENGTH+7)):$(($PWD_LENGTH-7))}"
else
echo "$FIXED_PWD"