How do I write a shell script that displays SQLite results? I have written a script that adds an entry to the SQLite database. Now I want to display the results after adding
If you need to assign sqlite SELECT result to a shell variable, you can do this.
r=$(sqlite3 your_db_path.db "select something from some_table where condition")
$r will be your variable.
Single row also can be fetched. You can do some work to split it into an array, may be using IFS
Additionally keep in mind to use #!/bin/bash convention on top of your every shell script. It'll solve many unwanted issues. Some times old #!/bin/sh convention gives troubles. :).