Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: I need some pearls of wisdom

by hipowls (Curate)
on Feb 23, 2008 at 00:39 UTC ( [id://669693]=note: print w/replies, xml ) Need Help??


in reply to I need some pearls of wisdom

This is easier from the command line

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}'
you can use find to find the files that you want to change.
find <directory list> <predicates> -exec perl -i.bak -pe'...' {} \;
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> -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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://669693]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-18 14:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found