-
-
Save mkhl/1474167 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cdup { | |
local dir=$PWD | |
local target=${*:-.git} | |
until [ -e "$dir/$target" -o "$dir" = "/" ]; do | |
dir="$(dirname "$dir")" | |
done | |
test -e "$dir/$target" && cd "$dir" | |
} | |
function catup { | |
local target=$* | |
(cdup "$target" && cat "$target") | |
} | |
function lsup { | |
local target=$* | |
(cdup "$target" && ls -l "$target") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment