Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soaxelbrooke/1a74854d1623ad1ec6653d35ecd7d444 to your computer and use it in GitHub Desktop.
Save soaxelbrooke/1a74854d1623ad1ec6653d35ecd7d444 to your computer and use it in GitHub Desktop.
Execute a multi-line sqlite script without having to create a script file! Works with make!
echo ".mode csv && .header on && .once report.csv && select * from report;" | sed -E -e 's/\s*\&+\s*/\n/g' | sqlite3 database.sqlite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment