in reply to I need some pearls of wisdom
This is easier from the command line
you can use find to find the files that you want to change.perl -i.bak -pe's{/sbin/sh\s+/usr/adm/best1_default/bgs/scripts/best1a +gent_start\s*>>\s*\$LOG\s+2>>\s*\$LOG\s*$} {/usr/bin/su - patrol /usr +/adm/best1_default/bgs/scripts/best1agent -q}'
If you are feeling very brave you can drop the .bak from the command line but it is safer to remove the backups after you have checked the result.find <directory list> <predicates> -exec perl -i.bak -pe'...' {} \;
find <directory list> -name '*.bak' | xargs rm
Disclaimer: I haven't run this command line on any of my files. I suggest you test it on a copy of a known bad file first.
|
|---|