[PLUG] awk and sed vs php

Russ Gilman-Hunt gilmanhunt at comcast.net
Fri Nov 4 21:45:09 UTC 2005


Actually, I've already made a backup of the files and would be
practicing on a copy, before I made such a ... scary change ;) Thanks,
however, for the tip on the --backup flag.
-Russ

On Fri, 2005-11-04 at 13:39 -0800, Russell Senior wrote:
> >>>>> "Russ" == Russ Gilman-Hunt <gilmanhunt at comcast.net> writes:
> 
> Russ> If I recall correctly, sed'll take an input file, and I can
> Russ> match something like (^SOA ... 200\d+) and change it to the
> Russ> right serial number. How do I go about writing this sort of sed
> Russ> recipe thing? I'm thinking ...
> 
> Russ> for i in $(ls /var/named/db.*) do sed something < $i > b && mv b
> Russ> $i done
> 
> I'd recommend using something that will backup your files temporarily
> until you are confident your commands executed correctly.  Check out
> the --backup options to mv.
> 
> 




More information about the PLUG mailing list