I'm new into shell and stuff, and i encountered a problem. I have to count how many lines have the files in a directory together
with this i count the line length of each file in for $i:
find $i -maxdepth 1 -type f -exec wc -l {} \; | tr -s " " | cut -d " " -f 2
i is a list of directories and the upper code is in a foreach cycle the output of this are number how many lines has the actual file, now i just have to sum them
But i need to sum the lenght for all files in the directory
tried to add the line to some variable:
@ variable = (`find $i...`)
but it gave me badly formed number error.
anybody has an idea how to solve this? im desperate, trying to do it for whole day,