From 74b3792583815905c0277ded70c65b2c563f6c3a Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Fri, 14 Oct 2011 12:38:42 +0300 Subject: [PATCH] Sexier file sourcing. --- .bash_profile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.bash_profile b/.bash_profile index 36ca3849092..28a11661b86 100755 --- a/.bash_profile +++ b/.bash_profile @@ -1,9 +1,9 @@ # Load ~/.bash_prompt, ~/.exports, ~/.aliases, ~/.functions and ~/.extra # ~/.extra can be used for settings you don’t want to commit -for file in bash_prompt exports aliases functions extra; do - file="$HOME/.$file" - [ -e "$file" ] && source "$file" +for file in ~/.{bash_prompt,exports,aliases,functions,extra}; do + [ -r "$file" ] && source "$file" done +unset file # Case-insensitive globbing (used in pathname expansion) shopt -s nocaseglob @@ -12,4 +12,5 @@ shopt -s nocaseglob [ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh # Add tab completion for `defaults read|write NSGlobalDomain` +# You could just use `-g` instead, but I like being explicit complete -W "NSGlobalDomain" defaults \ No newline at end of file