Variable $adsQ is an output of sql. This variable has number of lines in matrix format. When I pass this variable with pipe to while loop, it works fine whereas I loose variable required from while loop. As suggested from other forums, I modified with followings
varout=''
while IFS= read -r adrow;
do
<... do something....>
varout="$varout $adrow"
done < <(printf '%s\n' $adsQ)
echo "output of while $varout"
echo "AFTER adsVal >> $adsVal"
when I run this, i get error stating
test.sh: line 72: syntax error near unexpected token <'
test.sh: line 72:
done < <(printf '%s\n' $adsQ)'