I want to write a shell script that firstly opens sqlite and then makes a copy of a table and finally deletes the contents of that table. How can I do it in a shell script?
>>cd /var/www/dbs
>>sqlite3 ha.db
sqlite>>.timeout 2000
sqlite>>INSERT INTO table1 SELECT * FROM table2;
sqlite>>DELETE * FROM table2;
sqlite>>.quit
How to write this part?
>>sqlite3 ha.db
sqlite>>INSERT INTO table1 ('a1','a2') VALUES ('1','2');
sqlite>>.quit