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"
|
then \cd "$HOME"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
\cd "$1"
|
||||||
touch "$HOME/.bash_cdhistory"
|
touch "$HOME/.bash_cdhistory"
|
||||||
old=$( tail -n 149 "$HOME/.bash_cdhistory" )
|
old=$( tail -n 149 "$HOME/.bash_cdhistory" )
|
||||||
echo "$old" > "$HOME/.bash_cdhistory"
|
echo "$old" > "$HOME/.bash_cdhistory"
|
||||||
\cd "$1"
|
|
||||||
p=$( pwd )
|
p=$( pwd )
|
||||||
b=$( basename "$p" )
|
b=$( basename "$p" )
|
||||||
echo $b":"$p >> "$HOME/.bash_cdhistory"
|
echo "$b:$p" >> "$HOME/.bash_cdhistory"
|
||||||
}
|
}
|
||||||
alias cd=cd_history
|
alias cd=cd_history
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user