I can resolve this problem, but I don't understand, why happen this..it happens.
- 1st step: Query a number from a DB with sqlplus,
- 2nd step: Format some text for a mail,
- 3rd step: send a mail with these
- 1st step: Query a number from a DB with sqlplus,
- 2nd step: Format some text for a mail,
- 3rd step: send a mail with these.
psnr() { sqlplus -s USR/PASS@PROD << EOS SET PAGESIZE 0 SET COLSEP ";" SET FEEDBACK OFF SET TRIMOUT ON SET TRIMSPOOL ON select max_number-last_number from postalslip where state = 'OPEN' / exit / EOS }
psnr() {
sqlplus -s USR/PASS@PROD << EOS
SET PAGESIZE 0
SET COLSEP ";"
SET FEEDBACK OFF
SET TRIMOUT ON
SET TRIMSPOOL ON
select max_number-last_number from postalslip
where state = 'OPEN'
/
exit
/
EOS
}
PSNR=$(psnr)
PSNR=$(psnr)
echo "Today's result is: $PSNR" > $MAILTMP
echo "Today's result is: $PSNR" > $MAILTMP
od -c mailtmp.17872.txt 0000000 T o d a y ' s r e s u l t i 0000020 s : \t 1 2 3 4 5 0000040 6 7 \n 0000043
od -c mailtmp.17872.txt
0000000 T o d a y ' s r e s u l t i
0000020 s : \t 1 2 3 4 5
0000040 6 7 \n
0000043
That damned tab '\t' is what I don't understand: where does it comescome from. from, from sqlplus? Possibly Possibly DB specificity? (I checked in TOAD, both coloumns are number(18) Maybe. Maybe the funcitonfunction in ksh have some special featuresfeatures?
Thank you all answers in advance and sorry for my english.