APM: Modify in place and Argument list too long

Marc Majcher majcher at majcher.com
Mon Mar 17 12:53:13 CST 2003


dbii at mudpuddle.com (David Bluestein II):

:I'm doing a perl modify in place for a directory full of html files, yet I
:have several directories which have too many files for this:
:
:bash# perl -pi -e 's/oldtext/newtext/g' *html
:bash: /bin/perl: Argument list too long

Use find.  Something along the lines of:

find /path/to/dir -name "*html" -exec perl -pi -e 's/oldtext/newtext/g' {} \;

Works slightly differently on different systems.  Consult your man.

-- 
DVS
THERE COULD BE BUGS IN EVERY SINGLE MEAL YOU EAT!!!



More information about the Austin mailing list