Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirection Question 1

Status
Not open for further replies.

walkingseed

Technical User
Jan 1, 2006
12
US
find ./ -name *.htm | perl fix.pl

I have the above command where I want to change a fiew characters in all of the html files in a directory tree. How do I get the output from find to redirect into my perl program? I know this can be done, I've done it before but I can't remember how.
 
That command already does redirect the output of [tt]find[/tt] into the Perl script.

Though it isn't what you described, are you perhaps looking for [tt]xargs[/tt]? That will call the Perl script using the filenames output by [tt]find[/tt] as command line arguments.
 
Thank you. xargs did it. That was the command that I could not remember.

find ./ -name *.htm | xargs -i perl fix.pl '{}'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top