I
am
using
basic
sed
expression :-
sed -n "am/,/sed/p"
to get the text between "am" and "sed" which will output "am \n using \n basic \n sed". But my real problem is if the string would be :-
I
am
using
basic
grep
expression.
I applied the above sed in this sentence then it gave "am \n using \n basic \n grep \n expression" which it should not give it. How to discard the output if there would be no matching?
Any suggestions?