當我通過shell腳本執行DB查詢只得到價值我得到以下輸出需要從輸出
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Jun 22 02:50:47 2017
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Release 10.2.0.5.0 - 64bit Production
SQL>
SUM(SUM(CURRENTCOUNT))
----------------------
1182870
SQL> Disconnected from Oracle Database 10g Release 10.2.0.5.0 - 64bit Production
我需要使用sed
刪除其它內容,並得到唯一1182870
我用
sed -n '/COUNT(\*)/{n;n;p}'