Note: The archives category content is an automatically generated focus channel and does not neccessarily reflect the opinions of this blog. No responsibility is taken for the external links presented here, follow at your own discretion.
The archives content is never scraped from sites - but an abstract obtained from search engines.
| Problem |
Solution |
Example |
Reference |
Recommended |
You want to substitute a pattern in a number of files, making backups and modifying in place on the fly. And you can do this in Perl - with a one liner!
|
|
| Problem |
Solution |
Example |
Reference |
Recommended |
An amazing bit of Perl and so quick! This one liner will replace all occurrences of a pattern, with your replace and even create backups of files edited.
|
|
| Problem |
Solution |
Example |
Reference |
Recommended |
You can even pass in a wildcard. perl -pi'.bak' -e's/pattern/replace/g' filename Here is a demo of replacing all occurrences of unix with UNIX, in all html files. perl -pi'.bak' -e 's/unix/UNIX/g' *htm*
|
Leave a Reply