basic shell scripting question

If I did indeed grep something out of it, why woudln't $result show nothing?
When I do $? , it does show success...

What is the proper syntax so that $result shows actual thing it's grepping out?

result=`(ssh $host tail -1 /something/somethingelse) | egrep -i "value" >dev/null`

#echo $result
#
#echo $?
#0

result=`(ssh $host tail -1 /something/somethingelse) | egrep -i "value" >dev/null`

Becuse that's what you told it to do.

u r abousteli rite.. that was stupid of me

I am trying to get below to be rite...

is this rite ?

in below.. (in dosomething), I cannot use elif.. since i have no condition..

can someone advise?

if something
then
somethingelse
else
dosomething <----- especialli this one
if something1
then
somethingelse1
else
somethingelse2
fi
fi