troubleshooting Question

How do I Search files and add line if not already present?

Avatar of EEK2
EEK2 asked on
Linux
6 Comments1 Solution267 ViewsLast Modified:
I have a series of files that are in sub-directories as follows:

\Folder1\
   \Sub-Folder1\File1.cfg
   \Sub-Folder2\File1.cfg
   \Sub-Folder3\File1.cfg
   \Sub-Folder4\File1.cfg

I need to search through all the .cfg files and insert a line of text if it is not already present - what is the best way to do this (something with SED)?

Thank you in advance.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros