If I have the following bash variable:
$ echo "${pos}"
201
719
744
205
354
...the following produces...
!#bin/bash
(
IFS=:
awk -v str2="$pos" -v sep="[$IFS]" '
BEGIN {
m = split(str2, b, sep)
for (i=1; i<=m; ++i) {print b[i]}
}
'
)
-----------------
$ ./myscript.sh
201
719
744
205
354
...but then doing...
(
IFS=:
awk -v str2="$pos" -v sep="[$IFS]" '
BEGIN {
m = split(str2, b, sep)
for (i=1; i<=m; ++i) {print b[i]+10}
}
'
)
------
./myscript.sh
211
...so the addition is working, but not printing results for all elements. Why not?