我在 Unix 中有一个文件,包含以下内容。
{
BTEQ 13.10.00.06 Mon Jun 3 03:01:13 2013
+---------+---------+---------+---------+---------+---------+---------+----
logon TDDEV/TVDW_APP,
*** Logon successfully completed.
*** Teradata Database Release is 13.00.01.06
*** Teradata Database Version is 13.00.01.06
*** Transaction Semantics are BTET.
*** Session Character Set Name is 'ASCII'.
*** Total elapsed time was 1 second.
+---------+---------+---------+---------+---------+---------+---------+----
call TVDW_APP.PROC_OPO_GET_MAX_BATCH_ID(V_MAX_BATCH_ID);
*** Procedure has been executed.
*** Total elapsed time was 1 second.
V_MAX_BATCH_ID
--------------
9
+---------+---------+---------+---------+---------+---------+---------+----
*** BTEQ exiting due to EOF on stdin.
*** Exiting BTEQ...
*** RC (return code) = 0
}
我想从这个文件中提取数字“9”并将其分配给一个变量。我该怎么做呢?请帮忙。(我正在为此编写一个 ksh 文件;数字 9 在第 22 行,字符 11 到 14)