This could be a simple answer, but after Googling around I might just have the terminology down so I have yet to find anything about what I am asking.
When accepting an argument such as /bin/*.txt how do you iterate through each of the files?
I have tried this:
for file in $2; do
echo $file
done
The second argument ($2) has an input such as the /bin/*.txt but the echo only prints out 1 of the text files out of the 6 I have. Am I iterating through this incorrectly?
I have also tried using ls as such and it will not print out correctly either...
ls $2