Using Cygwin PDksh - But also have tested it on Linux with same results
----
I have a script that invokes a program/script and returns a string of data (1234 "12 34 56" 6789) and using "set -A" inserting it into an array.
script code snipit >>
get_array=$(php C:\\working\\php_array.php) # returns data string - for example (1234 "12 34 56" 6789)
set -A data_array $get_array #creates an array using the output from the program/script above
print "${data_array[0]}" # printing array elements
print "${data_array[1]}"
print "${data_array[2]}"
<<<
What I think should be returned is:
1234
12 34 56
6789
But what I get is:
1234
"12
34
56"
6789
When the script is run it doesn't return the expected (1234 "12 34 56" 6789) it returns (1234 "12 34). However, if I change the script to use the "set -A data_array 1234 "12 34 56" 6789 it returns the expected array construction.
What am I missing here?