shell - How to find a directory in Unix, whose ordinary files have the greatest line count together -



shell - How to find a directory in Unix, whose ordinary files have the greatest line count together -

ok, clear, school assignment, , don't need entire code. problem this: utilize

set subory = ("$subory:q" `sh -c "find '$cesta' -type f 2> /dev/null"`)

to fill variable subory ordinary files in specified path. have foreach count lines of files in directory, that's not problem. problem is, when script tested, big directories utilize path. happens script doesn't finish, gives error message word long. word subory. real problem, because $cesta can element of long list of paths. tried, cannot solve problem. ideas? i'm bit lost.

edit: clear, task assign each directory number, represents total line count of it's files, , pick directory greatest number.

you need reorganize code. example:

find "$cesta" -type f -execdir wc -l {} +

this run wc on files found, without ever running afoul of command line-length limitations, "invalid" characters newlines in filenames, etc. , don't need spawn new shell it.

shell unix freebsd csh

Comments

Popular posts from this blog

php - How to pass multiple values from url -

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

database - php search bar when I press submit with nothing in the search bar it shows all the data -