Hey Joe,
Looking at your output, I don't think your EOF is being matched and that's causing your issue.
For instance, I just wrote this quickly and ran it:
#!/bin/bash
cat <<EOF > OUTPUT
go
EOF
echo hi
And everything comes out in order. I noticed in your output that the
"go"
shows up in the wrong place in your output and the file doesn't get created until after you try to send the file.
Even if I put the select statement in, I don't the same disruption in output.
What I'm thinking is it might be a character in the
(sql part)
Would it be possible to post that?
Otherwise, try this also, just in case the Here Document redirection is misinterpreting spaces and/or tabs in your script.
Change:
db_rawamisql $env $component <<EOF > $file
To:
db_rawamisql $env $component <<-EOF > $file
and see if that does anything for you. Give that a try before you make any other mods. The answer might be that simple.
Thanks for replying. Hopefully we'll get this sorted out soon
, Mike