X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=.shellrc;h=eb741b1345c1124b90dc9bc7a96ece9ffe7c3357;hb=413f026368ce0d0e34b45dade2c931efbca98205;hp=85ca29e03d700b4abaa0db0b38288077388c9aac;hpb=7db5ad342b819ef150c3caf661bdad38de3120cd;p=dotfiles.git diff --git a/.shellrc b/.shellrc index 85ca29e..eb741b1 100644 --- a/.shellrc +++ b/.shellrc @@ -138,6 +138,19 @@ include() } +function mkcd { + if [ $# -ne 1 ]; then + echo "Usage: mkcd directory_name" >&2 + elif [ -d "$1" ]; then + cd "$1" + elif [ -e "$1" ]; then + echo "Error: $1 is a file" >&2 + else + mkdir -p "$1" && cd "$1" + fi +} + + mc() { if [ -n "$SLOWTERM" ]; then MC_SLOW="--slow"