bashrc/.bashrc.d/mkcd.bash

11 lines
165 B
Bash

mkcd() {
if [[ -v 2 ]]; then
echo "E: mkcd accepts only one argument"
exit 1
fi
# shellcheck disable=SC2164
mkdir -pv "$1" && cd "$1"
echo "cd: $(pwd)"
}