I need to find and replace some patterns in some files, but I need it to return 1 or something if a pattern is not found.
Can I do this with sed alone or do I need to check whether the pattern exists with another command?
Any suggestions?
|
I need to find and replace some patterns in some files, but I need it to return 1 or something if a pattern is not found. Can I do this with sed alone or do I need to check whether the pattern exists with another command? Any suggestions? |
|||
|
|
|
Check out this answer: How to check if Its pretty much the same as you are asking, its suggesting you use |
|||||
|