Grep file content into variable while retaining returns in bash

I'm using grep on a file and trying to parse the out put into a variable :

value=`grep "value" /file`
echo $vaule

But this returns the content of the file on one line it doesn't respect the returns at the end of each line. How can I fix this?
TotallyMeAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
TintinConnect With a Mentor Commented:
You need quotes

echo "$value"
0
 
omarfaridCommented:
can you give example ?
0
 
TotallyMeAuthor Commented:
That was easier than expected :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.