Is there a way to echo output that being piped to the next command? For example lets say that I can reading filenames from a text file and then running a command on that file:
cat files.txt | xargs -I{} -d"\n" command
The command runs and the output is displayed in the terminal, is there a way to print out the filename as well?
Lets say the input file contains:
file1.txt
file2.txt
Intended output:
file1.txt
[output of command with file1.txt as input]
file2.txt
[output of command with file2.txt as input]
Is there a way to get file1.txt
and file2.txt
in stdout as well?