Don't do it in one line for finding the error position. Execute each command separately, store the result, and pass it to the next command using a shell script.
However, there seems to be a single (unmatched) non-standard double quote (when copy and pasting here it shows as
”
and not as
"
) at
sed s/.*name=/"/