david.paige has asked for the wisdom of the Perl Monks concerning the following question:
I have been reading through the File::Find threads trying to find an answer to this question, but wasn't able to quite find it.
I want to write the equivalent of this ksh command in perl:
which should find all files, except those of .a or .o I am willing to redirect them to a file, and then read that into a file. (It was difficult for me to follow the redirections for Find::File.)find /h -depth -type f -name *.[!ao] -print
I was able to get fully qualified pathnames with File::Find, but wasn't able to exclude certain extensions, and I didn't quite follow some of the redirecting of standard output. If I change the default for standard output, does it revert at some point, or do I have to manually reset it?
What just occurred to me now, is the not completely elegant solution of running a ksh script, doing the file find, and then running the perl program, reading the file list from standard input. Maybe that would be easiest....
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Finding files excluding some
by ELISHEVA (Prior) on Mar 30, 2009 at 22:16 UTC | |
by Nkuvu (Priest) on Mar 30, 2009 at 22:35 UTC | |
Re: Finding files excluding some
by merlyn (Sage) on Mar 30, 2009 at 23:05 UTC | |
Re: Finding files excluding some
by Your Mother (Archbishop) on Mar 30, 2009 at 22:47 UTC | |
by afoken (Chancellor) on Mar 30, 2009 at 23:21 UTC | |
Re: Finding files excluding some
by Anonymous Monk on Mar 30, 2009 at 23:16 UTC |
Back to
Seekers of Perl Wisdom