I have five files each with a number in the first line.
I am attempting to write a bash script incorporating a for-loop that can calculate both the number (count) of the files and the sum of the numbers within in the files.
This is what I have attempted so far:
for file in $*
do
$[head -1 $file]
echo $(head -1)
done
I am unsure how to incorporate a sum and count element as yet.