One of things I always seem to be doing is searching for strings in files and changing them. I’ve gotten used to using Sed and VI for this. But perl also makes it easy to do via the command line.
Consider the following text file:
$ cat resolv.conf
search theunixzone.com
nameserver 10.1.1.1
nameserver 10.1.1.2
nameserver 10.1.1.3
By doing a command similar to [...]
Tag Archives: Perl
Using command-line Perl to search and replace
February 23, 2009 – 3:58 am