There may be times when you want to use grep to find only files that have some matchstring and then replace on a different string in the file than matchstring. String2 is the string that replace string1. String1 would ideally be the same string as matchstring, as the matchstring in the grep command will pipe only files with matchstring in them to sed. Matchstring is the string you want to match, e.g., "football" The pipe delimiter might be useful when searching through a lot of html files if you didn't want to escape the forward slash, for instance. Note: The forward slash '/' delimiter in the sed argument could also be a different delimiter (such as the pipe '|' character).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |