I wish to write a bash script that will read a file containing 100s of lines and look for the pattern
def <space>, if this pattern is found in the line, it will check the next line to see if the pattern
''' is present in this next line. If yes, then it checks if the next
''' is encountered 5 lines away. If all of these are yes, echo TRUE, else echo FALSE.
For example, file 1:
line 1 line2 ... def something... ''' random text rand..text rand.. ra.. '''
line 1 line 2 ... def something.. int a ...
There can be multiple such
def <space> patterns within the file and if any of them fails the test, the overall result is FALSE.
How do I do this using
bashis not a text processing tool, just so you know.
python -c 'inline script here'or