Sadly, the sqlite command line shell don't support variables.
For that i want to suggest to add the support of variables
in the command line shell.
For start thinking about it, i attached a proof of concept of the
feature. The license for the POC is the same as sqlite: public domain.
Comments about the POC:
1. I use another database (in memory) to persist variables between
changes of databases (.open command).
2. A missing part is add a command line argument similar to `-var
name value` for assign variables from the command line.