I need to extract data from files in directory /tmp/log.
I have no problem extract from single file.
#!/bin/bash
while read line;
do
echo $line
done < /tmp/log/file1
I want try it with multiple files /tmp/log/* but it returned error ambiguous redirect.
Any idea how can I around it?
You could read the files in a for loop as follows:
The strategy is just wrap your while loop with a for loop that takes care of processing each of the files one at a time.