Ok, to be clear, this is a school assignment, and I don't need the entire code. The problem is this: I use
set subory = ("$subory:q" `sh -c "find '$cesta' -type f 2> /dev/null"`)
to fill variable subory
with all ordinary files in specified path. Then I have a foreach where I count lines of all files in a directory, that's not the problem. Problem is, that when this script is tested, some big directories are use as the path. What happens is that the script doesn't finish, but gives error message word too long
. That word is subory
. This is a real problem, because $cesta
can be an element of a long list of paths. I tried, but I cannot solve this problem. Any ideas? I'm a bit lost.
EDIT: To be clear, the task is to assign each directory a number, that represents the total line count of all it's files, and then pick the directory with greatest number.