Last active
December 20, 2015 15:59
-
-
Save janmoesen/6158075 to your computer and use it in GitHub Desktop.
Not sure if I can ever forgive myself for this, but here goes: "automatically" creating "useful" aliases for "cd ../../../" etc.
See https://twitter.com/padolsey/status/364416098474541056
This file contains hidden or 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
stack=(''); | |
for i in {1..10}; do | |
printf -v alias_name '.%s' "${stack[@]}"; | |
printf -v path '../%s' "${stack[@]}"; | |
alias ".$alias_name"="cd $path"; | |
stack+=(''); | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment