I am relatively new to bash.
I had bash 3 In my mac by default.
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)
Copyright (C) 2007 Free Software Foundation, Inc.
I believe that I've installed and configured bash 5 for MacOSX. Running bash -version
command outputs:
GNU bash, version 5.0.3(1)-release (x86_64-apple-darwin18.2.0)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
The issue is I can't execute any of the Bash 5 features like this code uses a bash 4 feature can't output the expected behavior:
for i in {1..100..2} ; do
echo $i
done
outputs:
{1..100..2}
expected output:
1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
51
53
55
57
59
61
63
65
67
69
71
73
75
77
79
81
83
85
87
89
91
93
95
97
99