Skip to content

Instantly share code, notes, and snippets.

@nfarring
Created January 19, 2015 11:10
Show Gist options
  • Save nfarring/c335fb004bf1720494c3 to your computer and use it in GitHub Desktop.
Save nfarring/c335fb004bf1720494c3 to your computer and use it in GitHub Desktop.
Bash wrapper around sqlite3 to run SQL commands
#!/usr/bin/env bash
# Create the file "database.sqlite3".
#
# Reference: http://ss64.com/bash/syntax.html
which sqlite3 &> /dev/null
if [ $? -eq 1 ]
then
echo "sqlite3 not found"
exit 1
fi
sqlite3 database.sqlite3 <create_database.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment