I've been dealing with this for about 3 days. I tried most of the combinations of double and single quotes, looked at most of the stackoverflow questions and answers and still no luck :( Below is the simplified version of my problem.
> line="008256042a1b sh -c \"mysqldump databasename\""
> echo $line
008256042a1b sh -c "mysqldump databasename"
> docker exec $line
databasename": 1: databasename": Syntax error: Unterminated quoted string