Created
March 7, 2018 19:11
-
-
Save nicolascb/90464bac3b46cfb4b45f9ee0106ad8f3 to your computer and use it in GitHub Desktop.
SQLite SELECT using shell script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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