Use command substitution like this:
line=$(sed -n '2p' myfile)
echo "$line"
Also note that there is no space around the = sign.
Use command substitution like this:
line=$(sed -n '2p' myfile)
echo "$line"
Also note that there is no space around the = sign.