aboutsummaryrefslogtreecommitdiffstats
path: root/.bash_profile
diff options
context:
space:
mode:
authorMathias Bynens <mathias@qiwi.be>2012-07-02 16:04:55 +0200
committerMathias Bynens <mathias@qiwi.be>2012-07-02 16:04:55 +0200
commit67289cc183714676ad711fd4292f527b1821f0ec (patch)
treef7fd3e3e0b2654d98d8e1fd36e58e68ca032680c /.bash_profile
parent289c3ea4802552de01a030260916fcac55eaabe3 (diff)
downloaddotfiles-67289cc183714676ad711fd4292f527b1821f0ec.tar.gz
dotfiles-67289cc183714676ad711fd4292f527b1821f0ec.tar.bz2
dotfiles-67289cc183714676ad711fd4292f527b1821f0ec.zip
Enable some Bash 4 features when possible:
- `autocd` - Recursive globbing
Diffstat (limited to '.bash_profile')
-rw-r--r--.bash_profile10
1 files changed, 10 insertions, 0 deletions
diff --git a/.bash_profile b/.bash_profile
index cfb020b..31efec5 100644
--- a/.bash_profile
+++ b/.bash_profile
@@ -14,6 +14,16 @@ shopt -s histappend
# Autocorrect typos in path names when using `cd`
shopt -s cdspell
+# Enable some Bash 4 features when possible:
+# * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux`
+# * Recursive globbing, e.g. `echo **/*.txt`
+for option in autocd globstar; do
+ tmp="$(shopt -q "$option" 2>&1 > /dev/null | grep "invalid shell option name")"
+ if [ '' == "$tmp" ]; then
+ shopt -s "$option"
+ fi
+done
+
# Prefer US English and use UTF-8
export LC_ALL="en_US.UTF-8"
export LANG="en_US"