etc/dot/file/shrc
2022-11-09 05:28:19 +05:00

69 lines
685 B
Bash

#!/bin/sh
. $HOME/.profile
q(){
echo $SHLVL - 1 | bc
exit
}
tmpcdfile=`mktemp`
c() {
oldpwd=`pwd`
path=""
for v in $@ ; do
path="$path$v/"
done
if eval "command cd $path" && test -n $1 ; then
cat $CDHIST > $tmpcdfile
{ pwd ; goblin cat $tmpcdfile ; } | \
sed $CDHISTMAX'q' | \
goblin uniq -U > $CDHIST
fi
pwd
}
l() {
ls $@
}
la() {
ls -al $@
}
cds() {
acds | sed 10q | goblin quote | nl
}
acds() {
cat $CDHIST
}
b() {
num=$1
if test "$1" = "" ; then
num=1
fi
backcd=`sed -n $num'p' "$CDHIST"`
c "$backcd"
}
e() {
$EDITOR $@
}
t() {
tree $@
}
PS1=$PROMPT
test -r "$LOGIN" && . "$LOGIN"
test -r "$SETENV" && . "$SETENV" && setenv sh