Skip to content

Instantly share code, notes, and snippets.

@nicolascb
Created March 7, 2018 19:11
Show Gist options
  • Save nicolascb/90464bac3b46cfb4b45f9ee0106ad8f3 to your computer and use it in GitHub Desktop.
Save nicolascb/90464bac3b46cfb4b45f9ee0106ad8f3 to your computer and use it in GitHub Desktop.
SQLite SELECT using shell script
#!/bin/bash
hosts="$(
sqlite3 backup.db \
'select ip from hosts' \
)"
for host in $hosts; do
echo $host
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment