Created
March 9, 2012 22:09
-
-
Save iautom8things/2008984 to your computer and use it in GitHub Desktop.
shell script for aliasing long path names
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
################################## | |
# 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