How to determine if syntax array=( str1 str2 str3 ) to declare array is valid
Hi, I am creating a Korn shell script and need to create an array where each element corresponds to one line of an input file. Being able to do the following would be awesome:
Code:
array=( $(cat file.txt) ) Code:
ksh: syntax error: `(' unexpected I would really appreciate any tips on how I can find out the minimum requirements for this syntax to be valid. Thanks. |
Did not find any specific documentation, but was able to determine from my boxes, that it only works on ksh93. On other versions of KSH, need to use the "set -A array" or "array[index]=..." methods.
|
All times are GMT -5. The time now is 03:30 PM. |