So I'm working on a script that will passaccept arguments that are text files, and I should output the total amountnumber of lines in those files. Like For example, if I say
./myScript file1 file2 file3 it will print
10 total
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. I also know that, to get the amountnumber 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? Thanks friends