fixing bug where double spaces in paths are not recorded
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user