I'm on OS X, and I have a folder that contains a number of subfolders. There are two things I want to do. The first is to ensure that each subfolder has a file in it of the form [subfolder-name].grade.xml, then I need to search and replace within the appropriate file to make a couple of changes.
For the second part, I know how to use sed on an individual file to do what I need to, but I'm having the problem of verifying that the file is there, and then running the command on it. Any tips on doing this would be appreciated.
Note: I don't necessarily need a full answer, especially since I'm trying to learn here. A pointer in the right direction would be nice though.
(I realize that there may be better ways than the command line to accomplish this, but I've needed and will in the future need to do similar things on other Unix-based systems, so I'd rather know :)