shrc: better cding.
This commit is contained in:
parent
86a001ede7
commit
e87d654067
1 changed files with 16 additions and 2 deletions
|
@ -11,7 +11,13 @@ tmpcdfile=`mktemp`
|
||||||
|
|
||||||
c() {
|
c() {
|
||||||
oldpwd=`pwd`
|
oldpwd=`pwd`
|
||||||
if command cd $@ && test -n $1 ; then
|
path=""
|
||||||
|
|
||||||
|
for v in $@ ; do
|
||||||
|
path="$path$v/"
|
||||||
|
done
|
||||||
|
|
||||||
|
if eval "command cd $path" && test -n $1 ; then
|
||||||
cat $CDHIST > $tmpcdfile
|
cat $CDHIST > $tmpcdfile
|
||||||
{ pwd ; goblin cat $tmpcdfile ; } | \
|
{ pwd ; goblin cat $tmpcdfile ; } | \
|
||||||
sed $CDHISTMAX'q' | \
|
sed $CDHISTMAX'q' | \
|
||||||
|
@ -36,7 +42,7 @@ acds() {
|
||||||
cat $CDHIST
|
cat $CDHIST
|
||||||
}
|
}
|
||||||
|
|
||||||
bcd() {
|
b() {
|
||||||
num=$1
|
num=$1
|
||||||
if test "$1" = "" ; then
|
if test "$1" = "" ; then
|
||||||
num=1
|
num=1
|
||||||
|
@ -47,6 +53,14 @@ bcd() {
|
||||||
c "$backcd"
|
c "$backcd"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e() {
|
||||||
|
$EDITOR $@
|
||||||
|
}
|
||||||
|
|
||||||
|
t() {
|
||||||
|
tree $@
|
||||||
|
}
|
||||||
|
|
||||||
PS1=$PROMPT
|
PS1=$PROMPT
|
||||||
|
|
||||||
test -r "$LOGIN" && . "$LOGIN"
|
test -r "$LOGIN" && . "$LOGIN"
|
||||||
|
|
Loading…
Reference in a new issue