我正在編寫shell sripts,我需要通過sqlplus連接db。當我執行代碼SQLPlus線路大小
#!/bin/bash
result=$(sqlplus -s username/[email protected] << 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,但沒有工作。我應該做什麼其他編輯或配置?
我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
您是否嘗試說'echo「$ result」'而不是? – devnull
是的,它是工作devnull非常感謝你 – abidinberkay