我正在编写shell sripts,我需要通过sqlplus连接db。当我执行该代码时
#!/bin/bash
result=$(sqlplus -s username/password@DB << EOF
set linesize 32000;
set trimspool on;
SELECT * FROM number.IMEI_BLACK WHERE IMEI_14 = '22222224444444' and rownum < 10;
/
exit;
EOF)
echo $result
结果是这样,线条不正确,不能像这样读取。我设置了lineize 32000和trimspool,但是没有用。我应该做什么其他编辑或配置?
I D IMEI_14 IMEI_15 REASO TIME_ADDE TIME_TO_B NOTIFIED_TO_NETWORK C_FIRST_DETERMINATION_GROUP ---------- -------------- --------------- ----- --------- --------- ------------------- ------------------------------------ 123456789 222222224444444 2222222244444444 9999 09-DEC-13 14-DEC-13 0 ID IMEI_14 IMEI_15 REASO TIME_ADDE TIME_TO_B NOTIFIED_TO_NETWORK C_FIRST_DETERMINATION_GROUP ---------- -------------- --------------- ----- --------- --------- ------------------- ------------------------------------ 1234567829 2222223344444444 22222233444444442 9999 09-DEC-13 14-DEC-13 0
答案 0 :(得分:0)
你应该使用echo "$result"
应该做的伎俩。