diff --git a/qcd_function b/qcd_function index c962d33..7466b7a 100644 --- a/qcd_function +++ b/qcd_function @@ -114,7 +114,10 @@ Keeps a history of folders visited in ~/.bash_cdhistory unset OPTSTRING unset OPTIND if [ "$1" = "-" ] - then \cd -; return + then d=$( tail -n 1 ~/.bash_cdhistory ) + d=${d/*:/} + \cd "$d" + return fi d=$( grep $case -h ^"$1" ~/.qcd <( tac ~/.bash_cdhistory ) | head -n 1 ) d=${d/*:/}