etc/dot/file/shrc
2024-04-06 19:43:22 +05:00

78 lines
735 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 $@
}
cl() {
c $@
l
}
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 $@
}
ev() {
$VISUAL $@
}
t() {
tree $@
}
export PS1=$PROMPT
test -r "$LOGIN" && . "$LOGIN"
test -r "$SETENV" && . "$SETENV" && setenv sh