1
0

zsh: update

This commit is contained in:
Konstantin Demin 2024-02-13 18:54:46 +03:00
parent 8af457ab05
commit aea9334649
Signed by: krd
GPG Key ID: 1F33CB0BA4731BC6

View File

@ -14,3 +14,18 @@ alias 1='cd -'
for (( i=2 ; i < 10 ; i++ )) ; do
alias $i="cd -$i"
done ; unset i
## "Go to Dir" - create path if missing
gd() {
[ $# -lt 2 ] || echo "# gd() takes no more than one argument, seen instead: $#" >&2
case "$#" in
0 ) cd ;;
* )
if ! [ -d "$1" ] ; then
mkdir -p "$1" || return $?
fi
cd "$1"
;;
esac
}