Find & Replace with Perl

Aus Weis nix
Version vom 9. Februar 2011, 13:57 Uhr von Arne (Diskussion | Beiträge)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche

perl -pi -w -e 's/search/replace/g;' *.html

-e means execute the following line of code.
-i means edit in-place
-w write warnings
-p loop

Be sure to escape the special characters such as forward slash and . as each expression is a regular expression