Quote:
Originally Posted by pppaaarrrkkk
grep -on searchstring filename > LINENUM
|
That would save the result to a file called "LINENUM".
If by "stored in the shell" you mean in a variable, try:
Code:
LINENUM=$(grep -on searchstring filename)
echo $LINENUM