AIX Tip of the Week

AIX Tip of the Week: Perl Trick to Edit Multiple Files with One Command

Audience: AIX Users

Date: January 20, 2001

Here's a Perl trick that can simplify editing multiple files to make the same change. To illustrate, the following command changes all occurances of "LOTUS" to "IBM" in all files in the current directory.

$ perl -p -i -e "s/LOTUS/IBM/g" *

As with any global change command, be sure to back up the files before running the command. About IBM Help Search Feedback

Bruce Spencer,

January 20, 2001