I am running a bash script that includes a here document, which calls SQLPLUS. This includes a .sql script to perform several grants. It works correctly without the substitution.
I want to be able to substitute in a bash variable into the grant statements. Is that possible?
This is a snippet from the bash script
CREDLINE=ownusr/ownpass
GRANT2DO=foo.sql
PASSPROC=bar <=== this is what I want to pass
sqlplus << EOQ11
$CREDLINE@chaos01
@$GRANT2DO
quit
EOQ11
This is a snippet from the foo.sql
grant execute on $PASSPROC to user86;
grant execute on $PASSPROC to user99;
I have tried several variations on $VAR and &1, but none has worked so far.