diff --git a/bin/back b/bin/back new file mode 100755 index 00000000..5b4acd89 --- /dev/null +++ b/bin/back @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Jump to a parent directory +dir=$({ + _path=$PWD + while [[ -n "$_path" && "$_path" != "/" ]]; do + _path=$(dirname "$_path") + echo "$_path" + done +} | grep -i "$*" | tail -1) && cd "$dir"