Skip to content

Instantly share code, notes, and snippets.

@ethanbustad
Created September 10, 2014 00:04
Show Gist options
  • Save ethanbustad/fbf30be8e4729d805658 to your computer and use it in GitHub Desktop.
Save ethanbustad/fbf30be8e4729d805658 to your computer and use it in GitHub Desktop.
up script
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