I'm trying to debug my script, I'm new at bash and I can't understand the error. i tried to change it several times and warped line 60 with comments.
the error:
error: ./scriptdemo.txt: line 60: results_array: bad array subscript
#!/bin/bash
echo the script is running
#this part uses preCourses script to get preCourse demends for the input
course
results_array=''
reqursion_counter=-2
result_courses_counter=0
----------------------
....some more logic...
----------------------
results_array[$result_courses_counter]=${line_of_course[$len-$k-1]}
let result_courses_counter++
----------------------
....some more logic...
----------------------
results_arrayisn't an array, it's a string:results_array=''