0

I am new with Bash, and I am extending a script made by third parts.

In the following code snippet:

while IFS='|' read my_var
do
    (
     # commands based on $my_var
    ) &
done < <(psql my_db "SELECT ...")

I do not undertstand what < < does.

If < < were <, I would say the snippet would do:

  • run the SELECT... query on my_db.

  • take the result of the query ( a string of elements separated by | ) and store time by time each element in my_var.

  • run in parallel the commands inside every while loop, using each time a different value for my_var.

Is this correct?
How does having < < instead of < change things ?

Charles Duffy
  • 257,635
  • 38
  • 339
  • 400
Tms91
  • 2,594
  • 2
  • 27
  • 58

0 Answers0