I have a bash array which have paths in the form of string as its elements.
${arr[0]} = "path/to/json1"
${arr[1]} = "path/to/json2"
${arr[2]} = "path/to/json3"
and so on...
Now I want to pass all these elements as command line arguments to a python command within the same bash script at the same time
python3 script.py ${arr[0]} ${arr[1]} ${arr[2]}
But the problem is the number of elements in arr varies and is not fixed. So I can't hard code each element as a separate argument like above.
How can we pass all the elements of a bash array as command line arguments to python command?