aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/mkcd.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-10-04 02:34:13 +1300
committerTom Ryder <tom@sanctum.geek.nz>2014-10-04 02:34:13 +1300
commitc5bc116fac36b4492e74977daad81fea3a828345 (patch)
tree2eeaad048de94ef18675a81a3e404b19c9728fce /bash/bashrc.d/mkcd.bash
parentCorrect inverted test (diff)
downloaddotfiles-c5bc116fac36b4492e74977daad81fea3a828345.tar.gz
dotfiles-c5bc116fac36b4492e74977daad81fea3a828345.zip
New mkcd function
Diffstat (limited to 'bash/bashrc.d/mkcd.bash')
-rw-r--r--bash/bashrc.d/mkcd.bash5
1 files changed, 5 insertions, 0 deletions
diff --git a/bash/bashrc.d/mkcd.bash b/bash/bashrc.d/mkcd.bash
new file mode 100644
index 00000000..060e5f4a
--- /dev/null
+++ b/bash/bashrc.d/mkcd.bash
@@ -0,0 +1,5 @@
+# Create a directory and change into it
+mkcd() {
+ mkdir -p -- "$1" && cd -- "$1"
+}
+