etc/dot/file/shrc

57 lines
608 B
Text
Raw Normal View History

2020-11-04 02:03:20 +03:00
#!/bin/sh
2021-12-04 21:57:51 +03:00
. $HOME/.profile
2021-12-04 21:57:51 +03:00
q(){
echo $SHLVL - 1 | bc
exit
}
tmpcdfile=`mktemp`
c() {
oldpwd=`pwd`
if command cd $@ && 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
}
bcd() {
num=$1
if test "$1" = "" ; then
num=1
fi
backcd=`sed -n $num'p' "$CDHIST"`
echo $backcd
command cd "$backcd"
}
PS1=$PROMPT
test -r "$LOGIN" && . "$LOGIN"
test -r "$SETENV" && . "$SETENV" && setenv sh