- Nagios - Switch Interface Traffic
- How To - Linux Server Performance
- Notes - Building New ESXi Host for iSCSI with Jumbo Frames
- Microsoft Office Version Numbers (XP, 2003, 2007, 2010)
- ESXi Custom Welcome Screen Text
- PHP - Read Data from a CSV file
- PHP - Input Variables from URL
- Fix - WMI Error EventID 10
- Fix - EventID 4007 DNS Server Error
- FIX - CHECK_ESX3.PL Script
Tidbit - Find and Replace Text in Files with Perl
- TidBits:
In our Nagios / Webinject environment, we have alot of text configuration files. Sometimes a simple product update requires me to update LOTS of these files. A majority of the time, a find and replace is all I need. Using perl from the command line, I can quickly update a bunch of files saving countless hours of tedious file updates.
Example - Changing text string of Nagios WebInject test cases...
perl -pi -w -e 's/string1/string2/g;' *.xml
This command will replace "string1" with "string2" in all our XML files in the current directory. Of course I like to take a backup of the entire directory before I run something like this just in case.
- MWalker's blog
- Login to post comments
-
