Skip to content

Instantly share code, notes, and snippets.

@janmoesen
Last active December 20, 2015 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janmoesen/6158075 to your computer and use it in GitHub Desktop.
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
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