how to check for the end of file code example
Example 1: how to check if you are at the end of an file
while(!feof(stdin))
Example 2: get from match to end of file
For grepping all lines from match to end of file use onw of following:
sed -n '/matched/,$p' file
awk '/matched/,0' file