reverse bash history search

This commit is contained in:
ville rantanen
2013-02-22 10:11:51 +02:00
parent 79a5fb29e5
commit a2e7e28317

View File

@@ -70,7 +70,7 @@ function qcd() {
if [ -z "$1" ] if [ -z "$1" ]
then \cd then \cd
else else
d=$( grep ^"$1" ~/.qcd ~/.bash_cdhistory | head -n 1 ) d=$( tac ~/.bash_cdhistory | grep -h ^"$1" ~/.qcd - | head -n 1 )
d=${d/*:/} d=${d/*:/}
if [ ! -z "$d" ] if [ ! -z "$d" ]
then \cd "$d" then \cd "$d"