I'm creating a function in shell script and I need to pass 2 parameters. One is the path and the another is an array. But the problem is the second parameter is getting the content of the first parameter.
Ex.:
input_files_path="./path"
array=("Word1" "Word2" "Word3")
list_files(){
path=$1
array_in=("${@}")
echo "${array_in[@]}"
}
list_files "${input_files_path}" "${array[@]}"
Ouput:
./path Word1 Word2 Word3
If I change the second parameter to
array_in=$2
it doesn't work.