#!/bin/bash # $Id: fixup,v 1.1 2010-10-14 06:48:16 steve Exp $ # perform a one-shot fixup operation using find and perl. # originally starport/Config/makefiles/fix-old-makefiles # # This script is designed to be hand-edited for whatever fixup needs to be # performed; it's unlikely that any particular fixup will be needed twice. # # cmd: the PERL mini-script to be applied to every line of each Makefile. # typically either a conditional print, or a substitution. cmd='s/\\category/\\tags/' # flags: -i is edit in place; use -i.bak for testing # -n is loop over lines without printing; use with print unless... # -p is like -n but prints -- good for use with s/// flags="-i -p" find . -name \*.flk -exec perl $flags -e "$cmd" {} \; #cmd='print unless /^(FTP|HOST)/;' #flags='-i -n'