run sql/queries (postgres) within bash
e.g.
for things-to-buy in $(psql -d database-name -U username -c “select item from glossaries where priority = ‘urgent’ “;
do
blah, blah, blah …
done
Related posts:
- PostgreSQL Database psql Command Line Query Sometime psql command line query can be useful when it...
- Exim – anti-spam per domain setting acl_check_rcpt: blah … blah … blah … deny message =...
- bash – dealing with backtics ” ` ” in mysql statement problem : using backticks in bash for mysql statements. e.g....
- Bash: How to Echo Tab and Newline While printing out result in bash, sometime we need to...
March 30th, 2008 at 3:33 pm
you can also do the following:
echo “select * from cibailanjio” | mysql -uroot -p