Created
September 10, 2014 00:04
-
-
Save ethanbustad/fbf30be8e4729d805658 to your computer and use it in GitHub Desktop.
up script
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 up() { | |
if echo $1 | grep -E '^[0-9]+$' > /dev/null; then | |
cd "$(printf '../%.0s' $(eval echo {1..$1}))" | |
else | |
cd $(echo $PWD | sed -e $"s/\(.*$1\).*/\1/") | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment