This question already has an answer here:
Suppose I have used the grep command :
grep 'pattern' 'filename'
and have got the result :
Is there any way to concatenate the outputs into a single one like:
And also is there any way to count the number of outputs and store it in a separate variable?