我的代码:
echo -e "$Exception_result"
echo -e "$Exception_result" | mailx -s "$sub" "$emailTO"
Exception_result=`sqlplus -s / <<!
SET pagesize 0 heading off feedback off verify off echo off
COLUMN QUEUE_NAME format a50
column CNT format 99999
SET LINESIZE 30000
SELECT TBL.QUEUE_NAME, TBL.CNT
From \\blah blah
exit
!`
第一行将在Linux控制台上打印Exception_result的值。格式看起来还可以。 CNT列的每一行都很好地对齐。但是当第二行使用mailx发送邮件时,电子邮件中的格式未正确对齐。
控制台:
Bridge BOB BORG Bridge 596
Bridge INB Instrument Bridge 3686
Bridge TSI Trade Bridge 19039
TINT ACK AACK Message Status 861
TINT ERR Internal Msg Error 14571
TINT NAC Tint Not Acknowledged 27638
TINT REJ Message Rejected 3831
Trade ACK Trade Awaits Acknow 886
Trade ACW Trade Ack w Warning 21
Trade ERR Trade Ack with Error 80
Trade SDI No CPTY SDI Found 7128
Trade SIA CP SDI w ACK reqd 16272
Trade SUM Trade Manual to SUPE 1
Trade SUP Trade Auto to SUPE 187
电子邮件:
Bridge BOB BORG Bridge 596
Bridge INB Instrument Bridge 3686
Bridge TSI Trade Bridge 19039
TINT ACK AACK Message Status 861
TINT ERR Internal Msg Error 14571
TINT NAC Tint Not Acknowledged 27638
TINT REJ Message Rejected 3831
Trade ACK Trade Awaits Acknow 886
Trade ACW Trade Ack w Warning 21
Trade ERR Trade Ack with Error 80
Trade SDI No CPTY SDI Found 7128
Trade SIA CP SDI w ACK reqd 16272
Trade SUM Trade Manual to SUPE 1
Trade SUP Trade Auto to SUPE 187
解决方案?