I need to write a scrpt to change some text for all files stored under a particular directory and sub-directories. The script will read a file (replace.txt) and change the context of each file based on it. The file will have the following format :
For this to work, replace.txt has to be in the same directory as the script. You should also replace /var/tmp/test with the directory which holds the files you want to change.
NOTE: You can remove the "echo" lines if you wish, I did that just for testing.
AXISHK
ASKER
Do you mind to put comment in each line so that I can follow your logical ?
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
Open in new window
For this to work, replace.txt has to be in the same directory as the script. You should also replace /var/tmp/test with the directory which holds the files you want to change.
NOTE: You can remove the "echo" lines if you wish, I did that just for testing.