3 ms·
# create a directory in the current directory and cd to it function mkcd() { mkdir -p "$@" && eval cd "\"\$$#\""; }
by thunderbong 6y ago
# create a directory in the current directory and cd to it
function mkcd() { mkdir -p "$@" && eval cd "\"\$$#\""; }
- teddyh 6y agoWhy the eval? This works fine for me: mkcd(){ mkdir --parents -- "$@" && cd -- "$@"; }