helm/bin/back

11 lines
220 B
Plaintext
Raw Normal View History

2016-02-25 21:09:39 -08:00
#!/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"