Answer the question
In order to leave comments, you need to log in
How to write sqlite3 output to bash variable?
I want to write the output of sql3 to a shell variable in the provided script.
#!/bin/sh
sqlite3 test.db <<EOF
create table n (id INTEGER PRIMARY KEY,f TEXT,l TEXT);
insert into n (f,l) values ('john','smith');
select * from n;
EOF
exit 0;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question