fixing bug where double spaces in paths are not recorded

This commit is contained in:
ville rantanen
2019-04-23 07:45:18 +03:00
parent 9757f08d7c
commit 96c852d313

View File

@@ -48,13 +48,13 @@ function cd_history () {
then \cd "$HOME"
return
fi
\cd "$1"
touch "$HOME/.bash_cdhistory"
old=$( tail -n 149 "$HOME/.bash_cdhistory" )
echo "$old" > "$HOME/.bash_cdhistory"
\cd "$1"
p=$( pwd )
b=$( basename "$p" )
echo $b":"$p >> "$HOME/.bash_cdhistory"
echo "$b:$p" >> "$HOME/.bash_cdhistory"
}
alias cd=cd_history