bashrc: added a check for bash version 4 or newer
This commit is contained in:
parent
76a1a46eba
commit
94ec834c71
1 changed files with 13 additions and 5 deletions
18
.bashrc
18
.bashrc
|
@ -1,11 +1,19 @@
|
||||||
# .bashrc
|
# .bashrc
|
||||||
|
|
||||||
# Source global definitions
|
# Source global definitions
|
||||||
if [[ -r /etc/bashrc ]]; then
|
if [[ -r /etc/bashrc ]]; then
|
||||||
. /etc/bashrc
|
. /etc/bashrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Source .bashrc.d
|
# Bash 4 or bust
|
||||||
for file in ~/.bashrc.d/*.bashrc; do
|
if (( BASH_VERSINFO[0] < 4 )); then
|
||||||
. "$file"
|
echo "Please get a newer version of Bash."
|
||||||
done
|
echo "Your bashrc won't work otherwise."
|
||||||
|
else
|
||||||
|
# Source .bashrc.d
|
||||||
|
for file in ~/.bashrc.d/*.bashrc; do
|
||||||
|
. "$file"
|
||||||
|
done
|
||||||
|
|
||||||
|
unset -v file
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue