Re: [GENERAL] multiple sql results to shell

2017-10-23 Thread Randy Strauss
On Oct 23, 2017, at 08:37, pgsql-general-ow...@postgresql.org wrote: psql . | while read a; do #some code done The only problem I find with this is that you can't pass variables out of the while loop, To get input from a file w/o a sub-shell,

Re: [GENERAL] multiple sql results to shell

2017-10-23 Thread Geoff Winkless
On 23 October 2017 at 15:08, Mark Lybarger wrote: > I have this bash/sql script which outputs some curl commands. the backticks > causes it to get interpreted by the shell. This works fine if there is one > result, but when there are many rows returned, it looks like one shell > command. > > an

Re: [GENERAL] multiple sql results to shell

2017-10-23 Thread David G. Johnston
On Mon, Oct 23, 2017 at 7:08 AM, Mark Lybarger wrote: > I have this bash/sql script which outputs some curl commands. the > backticks causes it to get interpreted by the shell. This works fine if > there is one result, but when there are many rows returned, it looks like > one shell command. >

[GENERAL] multiple sql results to shell

2017-10-23 Thread Mark Lybarger
I have this bash/sql script which outputs some curl commands. the backticks causes it to get interpreted by the shell. This works fine if there is one result, but when there are many rows returned, it looks like one shell command. any help on getting multiple rows returned to be executed by the