Joe Conway wrote:
> Try:
> psql -A -t -U $DBUSER -d $DB -c "$QUERY" -F $'\t'
That's excellent, but please let me post a different way :)
by passing commands from stdin:
#!/bin/sh
cat <<EOT | psql -q -A -t -U $DBUSER -d $DB
\f '\t'
$QUERY
EOT
I think this will work even if your /bin/sh is not bash
(like FreeBSD and NetBSD).
Cheers,
Kazuyuki