Skip to content

Instantly share code, notes, and snippets.

@namomo
Last active October 28, 2015 02:05
Show Gist options
  • Save namomo/8db5240ac3006648bd4c to your computer and use it in GitHub Desktop.
Save namomo/8db5240ac3006648bd4c to your computer and use it in GitHub Desktop.
bash db query
#!/bin/bash
QUERY=`mysql -u[ID] -p[PW] -s -N -e "select email from [DATABASE].[TABLE]"`
for email in ${QUERY}; do
echo ${email}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment