qcd - for previous
This commit is contained in:
@@ -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/*:/}
|
||||||
|
|||||||
Reference in New Issue
Block a user