summaryrefslogtreecommitdiff
path: root/etc/functions/mkcd
blob: c4a8c5d916e356de28d4c570e08db0eaa55afd44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
## vim:ft=zsh
## create a directory, then change into it
typeset -i ls=0
typeset dir=$1

if [[ -z $dir ]] {
	echo "Usage: mkcd <directory name>" > /dev/stderr
	return 1
}
[[ -d $dir ]] && ls=1
mkdir -p $dir
cd $dir
((ls)) && ls
true