-----my input file [file name -- test]
centos is my bro
red hat is my course
ubuntu is my OS
fqdn is stupid
tom outsmart jerry
red hat is 3
red hat is friend
red hat is my boy
jerry is small
---- my code
#! /bin/bash
grep -C1 --color=always "red hat" test
--- expected output
centos is my bro
red hat is my course
ubuntu is my OS
--
tom outsmart jerry
red hat is 3
red hat is friend
--
red hat is 3
red hat is friend
red hat is my boy
--
red hat is friend
red hat is my boy
jerry is small
---- coming OUTPUT
centos is my bro
red hat is my course
ubuntu is my OS
--
tom outsmart jerry
red hat is 3
red hat is friend
red hat is my boy
jerry is small
---- please provide the necessary option for the grep command to get the expected output
----- if there is some other way to achieve this output
----- please give reference and the comments in the code