Running a Sqlite3 Script from Command Line
For the lazy who want to just dump this into their .bashrc
:
### Execute an sqlite3 file on a given dbsql3-exec () { # TODO: write a --help flag that doubles as error handling # TODO: Ensure that $1 is a db; Else display --help # TODO: Ensure that $2 is a .sql file; Else display --help # TODO: Probably store a backup (or at least a flag)... sqlite3 $1 ".read $2" true}