Deleting double quoted string from a line when line number is variable

I need to remove double quoted strings from specific lines in a file. The specific line numbers are a variable. For example, line 5 of the file contains

A B C "string"

I want to remove "string". The following sed command works:

sed '5 s/\"[a-zA-Z0-9]*\"//' $file 

If there are multiple lines in the file that need to edited and the line number is a variable, i.e. $lineno, the following does not work:

sed '$lineno s/\"[a-zA-Z0-9]*\"//' $file  

I believe the sed command must be double quoted for the variable to be evaluated, so I tried that and I get the error - Unmatched ".

sed "$lineno s/\"[a-zA-Z0-9]*\"//" $file

You can double-quote part of a string, like so:

sed "$lineno"' s/"[a-zA-Z0-9]*"//' $file 

I don't think you need to escape " inside single-quotes(since sed shouldn't need them) as nothing can be escaped inside single quotes anyway.

That worked - I feel stupid!