Variables in shell script

mysqldump --compact --add-drop-table -h192.168.150.80 -uroot -p somePass $combined | sed '/$combined/$table/g' | mysql $database

The sed part is not working from the above statement.
The variables combined and table are already defined and instead of showing the actual variable, it is executing the $/combined/$table in the sed part.
How do I replace the variables and then use the sed command?

That is becuase the single qout ' character prevents the shell from "translating" the variable. It sees it as a literal $variablename.

Change the ' to double quotes "

When I used double quotes, the grep statement translates without any quotes.

Did you get the desired output ?..

If not , post the sample input and the output your expecting .

The problem was resoved when I added the "s" in double quotes like this...

sed "s/$combined/$table/g"