Eval and get awk output assigned to variable

I want to do 2 things in single line that is evaluating a command to get return code and store $2 of awk if the command exit code is 0.

eval "ade desc ${filename}@@/<branch_name> | grep Version | awk '{print $2}' 2>&1 1>/dev/null"
ret=$?
        echo "$ret $val"
        if [ $ret == 0 ]
        then
                array_b2+=(${filename})
                continue
        fi

Here I am able to get the exit code but how to get the value obtained after awk command executed?

Not quite clear.
Which command's exit code do you want to capture? $? is the last cmd's exit code and should always be 0 in above.
Where (and how) do you want to store whatever result you mean?
Why do you redirect stdout and stderr to /dev/null if you want some result?
Why do you use eval in above?

No I get 0 always when I don't use eval and do like $(CLI command) or `command` , using eval I am getting 0/1(tested), which is ok for my plan.
I want to store version i.e $2 that I got after awk operation
It throws error on stdout in case if the given filename does not belongs to that branch but I got your point that grep will anyway eliminate those output

I can only emphasize what RudiC has said. Generally speaking: if you ever write a line with awk and grep ending in the same pipeline you are doing something wrong. In your case

... | awk '/Version/ {print $2}' | ....

will do the same as

... | grep "Version" | awk '{print $2}' | ....

Furthermore, the eval should only be used as a very last measure. In 99% of the time it is better to avoid it. I can't even see what the purpose of it should be in your case. Care to explain what, in fact, you are trying to do (the big picture, not the syntactical problem you had)?

I hope this helps.

bakunin