Just trying to learn bash scripting a little. My old bash version:
Bash version 3.2.53(1)-release...
I've updated my bash on mac os x yosemite with homebrew:
brew update
brew install bash
Then in terminal properties I’ve changed the standard shell path from /bin/bash
to /usr/local/bin/bash
(As I understand this is where the homebrew installs the updated bash).
Then I checked the result again (and seems like it's all good):
$ echo $BASH_VERSION
Bash version 4.0.33(0)-release...
But when I was trying to write a simple bash script:
#!/bin/bash
echo "Bash version ${BASH_VERSION}..."
for i in {0..10..2}
do
echo "Welcome $i times"
done
THE RESULT IS:
Bash version 3.2.53(1)-release...
Welcome {0..10..2} times
INSTEAD OF:
Bash version 4.0.33(0)-release...
Welcome 0 times
Welcome 2 times
Welcome 4 times
Welcome 6 times
Welcome 8 times
Welcome 10 times
Why the Bash version changes back to old one when I'm trying to execute script in the same shell??? This just freaks me out! Please someone explain me what's my problem)))