0

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)'

codeforester
  • 39,467
  • 16
  • 112
  • 140
rajeshemailto
  • 11
  • 1
  • 1

1 Answers1

0

You have an extraneous < in your command. You wrote

done < <(...)

Remove the first <.

user1934428
  • 19,864
  • 7
  • 42
  • 87