ksh arrays

Hi,

I have a ksh script in which I need to fill an array with a list of filenames.
It currently works like this:

set -A array \
  val1 \
  val2 \
  val3

However, I was wondering why it's not possible to do something like this to make it easier to parse values to the array:

set -A array <<EOF
  val1
  val2
  val3
EOF

Because it would be syntactically incorrect. You could however do this:

set -A array $(
cat << EOF
  val1
  val2
  val3
EOF
)
1 Like

Thanks, that makes sense

Or:

array=(
  val1
  val2
  val3
)