In article <4235B688.8000407@blueseacommunications.com>,
Paul Cunningham <paul@blueseacommunications.com> wrote:
% I use a bash script (similar to following example) to update tables.
%
% psql -v passed_in_var=\'some_value\' -f script_name ....
%
% Is it possible to pass a value back from psql to the bash script?
If you run it like this
$(psql -v passed_in_var=\'some_value\' -f script_name)
and arrange for all the script output to be in the form
var1="value 1" var2="value 2"
var3="value 3" ...
then var1, var2, etc will be set in bash (or ksh, or the posix shell).
Note that there are no spaces around the equals signs.
--
Patrick TJ McPhee
North York Canada
ptjm@interlog.com