I have a bunch of xml file in the current directory.
Problem 1.
As far as I have read eval returns the results and stores it in a variable. But I get an error with the below command
find ./ -name '*.xml' | file=$(eval awk '{print $0}') ; echo $file
EDIT ( after ommitting eval as pointed by cas ) -
Omitting eval just returns an empty string.
find ./ -name '*.xml' | file=$(awk '{print $0}') ; echo $file
Problem 2.
I am just trying to learn bash and hence I made a complicated sequence of diffing the first two files from the output of find. The complicated sequence is just to understand the concepts of bash programming.
find ./ -name '*.xml' | file=$(awk '{print $0}') ; echo $file && diff -y $(sed '2q;d' $file) $(sed '1q;d' $file)