bash prompt: BUGFIX prompt with <space> on $PWD

This commit is contained in:
masterzu 2019-01-30 13:05:44 +01:00
parent 8517ba6699
commit 97aac46df0
1 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ function _my_parse_git_branch {
function short_path { function short_path {
# print first two letters of the path + last dir # print first two letters of the path + last dir
local home=/ho/patrick local home=/ho/patrick
echo $(dirname $1 | \ echo $(dirname "$1" | \
sed -e "s;$HOME;~;" | \ sed -e "s;$HOME;~;" | \
sed -e "s;\(/[^/]\{1,2\}\)[^/]*;\1;g")/$(basename "$1") | \ sed -e "s;\(/[^/]\{1,2\}\)[^/]*;\1;g")/$(basename "$1") | \
sed -e "s;$home;~;" sed -e "s;$home;~;"
@ -102,7 +102,7 @@ function prompt_func() {
# PWD # PWD
# prompt="${prompt} \w" # prompt="${prompt} \w"
prompt="${prompt} $(short_path $PWD)" prompt="${prompt} $(short_path "$PWD")"
# if test $previous_return_value -eq 0 # if test $previous_return_value -eq 0
# then # then