SQLite Forum

SQLite3 shell doing math operation on parameter substitution
Login
Ryan has the essence of your trouble; this is just added detail.

The first echo command in your sh script is having sh parameter expansion done, as you intend (I surmise.) However, the single quotes around your parameter values are not treated as text literal demarcation by the SQLite shell. As documented in section 4 of [the CLI doc](https://sqlite.org/cli.html), those quotes serve merely to (uselessly) delimit the value argument to the .parameter meta-command. If you want to specify a text literal to that meta-command, you will need to escape the quotes. And to get the escape character to the CLI from your sh script, you will need to escape that also (since it is within a double-quoted string subject to parameter expansion.)

Your sense that single-quotes will help is good; but you just need to get them past the two shell's interposed between what you write and what the .parameter implementation actually gets.

To see what actually gets to that meta-command,<br>
select * from temp.sqlite_parameters;<br>
may help.