This question already has an answer here:

In a bash script I have several arrays which I need to access in a gnuplot code:

# fill array a[*] and b[*]
gnuplot <<EOF
  do for [j=0:10] { # access ${a[j]} and ${b[j]} }

The problem is that ${a[j]} in the gnuplot code is not interpreted as element j of the array a.

How can I solve that?

marked as duplicate by Gilles bash May 3 '16 at 23:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.