etc/dot/file/shrc

79 lines
733 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`
2022-11-09 03:28:19 +03:00
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 $@
}
2022-11-13 12:23:06 +03:00
cl() {
c $@
l
}
la() {
ls -al $@
}
cds() {
acds | sed 10q | goblin quote | nl
}
acds() {
cat $CDHIST
}
2022-11-09 03:28:19 +03:00
b() {
num=$1
if test "$1" = "" ; then
num=1
fi
backcd=`sed -n $num'p' "$CDHIST"`
c "$backcd"
}
2022-11-09 03:28:19 +03:00
e() {
$EDITOR $@
}
2022-11-21 01:27:52 +03:00
ev() {
$VISUAL $@
}
2022-11-09 03:28:19 +03:00
t() {
tree $@
}
2022-11-13 12:23:06 +03:00
export PS1=$PROMPT
test -r "$LOGIN" && . "$LOGIN"
test -r "$SETENV" && . "$SETENV" && setenv sh