shell scripting - using a here document in a background job
Steve Flynn
anothermindbomb at gmail.com
Thu Aug 20 15:59:42 UTC 2009
I have a requirement to kick of a number of background processes from
within a shell script. It's actually 5 copies of sqlplus to run in
parallel, each one calling a stored procedure within Oracle with a
slightly different parameter. For example:
sqlplus ${user}/${password}@${database} & << EOF
execute table_analyze(${core_user});
/
EOF
sqlplus ${user}/${password}@${database} & <<EOF
execute table_analyze(${tran_user});
select * from dual;
/
EOF
If I run these calls to sqlplus serially, by removing the ampersand, I
get the expected behaviour - each command gets its 'here' document,
executes the stored procedure and exits
If I run them in the background the here document does not seem to be
passed sqlplus to process it. I've tried redirecting stdin but to no
avail. Any one got any ideas?
--
Steve
When one person suffers from a delusion it is insanity. When many
people suffer from a delusion it is called religion.
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
More information about the ubuntu-users
mailing list