NodeReaper has asked for the wisdom of the Perl Monks concerning the following question:

This node was taken out by the NodeReaper on Wed Sep 28 14:15:09 2005 GMT

Replies are listed 'Best First'.
Re: about split function
by halley (Prior) on Sep 28, 2005 at 14:10 UTC
    This has nothing to do with perl.
    man split
    man find
    find . -name "*.txt" -exec split {} {} \;
    I have not tested the final example.

    --
    [ e d @ h a l l e y . c c ]

      Thanx, it worked fine! Could you be so kind as to explain to me what the {} {} \ mean? I understand the rest of the code, but I can't understand those 3 things. Thanx again for your time!
        Not to be annoying, but RTFM. That's why I suggested it in the first place. Saying split(1) is Unix shorthand for saying "there's this feature called split and it can be found in volume 1 (external commands) of the Unix manuals, such as typing man 1 split or just man split."

        If you read the find man page, it explains that it will replace the {} with the currently found filename, and the \; is to terminate the -exec switch argument. (It's looking for just a ; but the shell would eat it if you don't escape it.)

        Why two {}s? Read the other man page to see how split(1) works. It needs the filename to split, and we give the name again as a prefix argument to give to each split output.

        --
        [ e d @ h a l l e y . c c ]