Find Replace

I want to do a simple find replace of a string in one line for all the files in a Unix directory

Useful when the Oracle DBA has to update a lots of SQL or shell scripts.

Example of a find replace: ~/sql directory has thousands of SQL files and I’d like to find out my_source_string and replace it with my_target_string:

find my_folder  -type f | xargs perl -pi -e 's/my_source_string/my_target_string/g'

Oracle Montreal find replace Unix string

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.