So I'm working on a script that will accept arguments that are text files, and should output the total number of lines in those files. For example, if I say
./myScript file1 file2 file3
it will print
10 total
(let us assume that the sum of all the lines from those three files is 10).
I know how to go over all the arguments. I also know that, to get the number of lines in a file, I would say:
wc -l < fileName
However, how can I make that into an "int" that I can add to some sort of cumulative sum?