
capturing an output variable into a shell variable
news:b2791e11.0207100807.4bfb5057@posting.google.com...
With stored proc execution, you usually get a bunch of dashes as a header
and a return code along with it. Something like this.
isql -S<DATASERVER> -U<LOGIN> -w999 <<-EOF ${TEMPFILE}
${PASSWORD}
exec <your proc>
go
EOF
The output that gets generated gets put in your ${TEMPFILE}, contents below.
result
---------------
593838293
(return status = 0)
Then you could strip away the first 2 lines, which you don't need and then
grab the result in a variable with head and awk.
VAR=`sed '1,2d' ${TEMPFILE} |head -1|awk '{print $1}'`