qcd - for previous

This commit is contained in:
q
2013-10-08 18:58:51 +03:00
parent 8fba0eec31
commit 651249417c

View File

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