I want to read the contents of a text file and check for the filenames with extension .txt and find merge those .txt files.Is there a way I could do this using bash?
For example, if the text file contains,
file1.txt, file2.txt
I want to read the strings with .txt extension and find merge those files which is in another location.
I tried the below,
txt_file="/tmp/Muzi/tomerge.txt"
while read -r line;do
echo $line
done <"$txt_file"
But, this prints out the complete text file and I am completely new using bash.