I need to count the number of lines in x files and compare which has more.
The one I've done only takes two files and compares them. Any idea how to make it x amount of files?
echo Enter the filename read fn echo Enter another file read fn1 for WORD in $(cat $fn) do echo "$WORD" done | wc -l for WORD in $(cat $fn1) do echo "$WORD" done | wc -l if (cat $fn | wc -l > cat $fn1 | wc -l) then echo First file has more lines than second file else if (cat $fn1 | wc -l > cat $fn | wc -l) then echo Second file has more lines than first file. fi