diff options
author | Mathias Bynens <mathias@qiwi.be> | 2012-07-02 16:04:55 +0200 |
---|---|---|
committer | Mathias Bynens <mathias@qiwi.be> | 2012-07-02 16:04:55 +0200 |
commit | 67289cc183714676ad711fd4292f527b1821f0ec (patch) | |
tree | f7fd3e3e0b2654d98d8e1fd36e58e68ca032680c /.bash_profile | |
parent | 289c3ea4802552de01a030260916fcac55eaabe3 (diff) | |
download | dotfiles-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_profile | 10 |
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" |