I have the results of a grep with -n store in a shell variable
ie
VAR=`grep -n -e 'PATTERN' file`
How ever I am missing the line breaks in the variable , How do I store the resualts of grep with many lines in to a variables. I want the varable should be the sawmway as we do the grep
fanstastic it worked ! My file is very large , so I do not want to grep it again and again! Instead do s single grep and store all insatnces together
Thanks