hope someone can help me with some very basic stuff. I'm currently writing a bashscript that is supposed to read some filepaths and to write it into an array but when I try to output the array afterwards it seems it is empty. Can someone tell me why?
#!bin/bash
counter=0;
find /home/ftpuser/TTT -type f | while read line;
do
origin[counter]=$line;
counter=${$counter + 1};
echo $counter
done
for(int i=0;i<${origin[@]})
do
echo ${origin[$i]};
done
The first echo outputs 1-124 but the second one absolutely nothing.