Unix script array

Unix shell script;

How do I create an array and dynamically populate it with values? How do I retrieve from the array?

you didn't mention what shell you're using.
If it's 'ksh', do 'man ksh' and search for 'array'.

I am doing in ksh

well then...... try looking into 'man ksh' as noted previously.

set -A <array_name> item1 item2 item3 item4 ....

or you can read from a file....
filename = /.../.../.../... #input file
set -A <array_name> [ < $filename]