They can be tricky to master, but once you are comfortable with them you'll be able to throw together a command to do exactly what you described in just a minute or two. There are plenty of tutorials around the web on regexps. The most important thing for you to grasp in terms of pattern matching and replacement is regular expressions. You could also use Perl instead of sed, as mentioned by travis.jennings, which probably gives you even more flexibility to do some things. sed allows you to use regular expressions to search for matching content, and replace matching occurrences with text of your choosing. The find command is a flexible and powerful way of finding files with any matching characteristicname, type, creation date, etc. ![]() It sounds like a combination of find and sed would do the trick for you. ![]() Actually, that's a pretty simple task to accomplish with a single command line statement.
0 Comments
Leave a Reply. |