From 96c852d313e0a206a6bda4326de3a45ee0665cd9 Mon Sep 17 00:00:00 2001 From: ville rantanen Date: Tue, 23 Apr 2019 07:45:18 +0300 Subject: [PATCH] fixing bug where double spaces in paths are not recorded --- qcd_function | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qcd_function b/qcd_function index 8a87d8f..d089f84 100644 --- a/qcd_function +++ b/qcd_function @@ -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