[clug] global string replacement

Damien Elmes clug at repose.cx
Fri Aug 15 16:44:00 EST 2003

Steven Hanley <sjh at wibble.net> writes:

> perl -i -pne 's/KPushButton/QPushButton/g' *
> -i is inplace editing, e is execute, n is line at a time input, cant
> remember p off the top of my head.

-n wraps an implicit while (<>) { .. }
-p wraps an implicit while (<>) { .. print; }

thus -n is redundant when using -p.

Damien Elmes

More information about the linux mailing list