0

I can't seem to get the array "args" to retain all elements in the script below. If I uncomment the echo inside the loop I get the results as expected. However, I need the result to use later in the script. Currently, if the array is called outside the loop, it only retains the last element. My theory is it's overwriting the element each pass and I've phrased it incorrectly. Can some please explain how to achieve this. Iv spent several hours fiddling with it.

for (( i=3; i<${#GameSystemShortName[@]}; i++ ));
do
RomCount=$($Pirompredir${GameSystemShortName[$i]}| wc -l)
args=("$RomCount")
#echo "${args[@]}"
done
echo "${args[@]}"
Slippy
  • 51
  • 8

0 Answers0