Skip to content

Instantly share code, notes, and snippets.

@iautom8things
Created March 9, 2012 22:09
Show Gist options
  • Save iautom8things/2008984 to your computer and use it in GitHub Desktop.
Save iautom8things/2008984 to your computer and use it in GitHub Desktop.
shell script for aliasing long path names
##################################
# folder shortcuts #
##################################
# - Use with "save >NICKNAME<" #
if [ ! -f ~/.dirs ]; then # if doesn't exist, create it
touch ~/.dirs
fi
alias show='cat ~/.dirs'
save (){
command sed "/!$/d" ~/.dirs > ~/.dirs1; \mv ~/.dirs1 ~/.dirs; echo "$@"=\"`pwd`\" >> ~/.dirs; source ~/.dirs ;
}
source ~/.dirs # Initialization for the above 'save' facility: source the .sdirs file
shopt -s cdable_vars # set the bash option so that no '$' is required when using the above facility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment