Created
April 21, 2011 23:01
-
-
Save TaurusOlson/935669 to your computer and use it in GitHub Desktop.
Bash function to source config files and create aliases
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
# Usage: init_config CONFIG_FILE | |
# Description: Source the configuration file, and create an alias to edit it | |
init_config() { | |
local CONFIG_FILE=$1 | |
if [[ -r $CONFIG_FILE ]] | |
then | |
source $CONFIG_FILE | |
CONFIG_ALIAS=".$(basename $CONFIG_FILE)" | |
alias $CONFIG_ALIAS="vi $CONFIG_FILE" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment