我用with data as (
select p.person_id,TRUNC ((SYSDATE - p.birth_date) / 365.25, 0) AS age
from person p
)
select '30 or below' as stat, sum(case when age between 0 and 30 then 1 else 0 end) as count from data
union all
select '31 to 60' as stat, sum(case when age between 31 and 60 then 1 else 0 end) as count from data
union all
select '31 to 130' as stat, sum(case when age between 31 and 130 then 1 else 0 end) as count from data
;
执行了一个包含cmd
指令的python文件来获取结果。
现在,结果显示为
'name.py dir'
我不想看到进度,只是想看到最后的结果,这是最后两行。
所以我尝试了这条指令....
....
processing
....
....
============
result 1 2 3
x.xxx <---- this is what I want to get
它显然找到'name.py dir | find 'result''
行,但没有显示真实结果'x.xxx'。
结果只是,
result
如何使用result 1 2 3
指令获取find
的下一行?
答案 0 :(得分:1)
尝试使用grep
grep -A 1结果
来自man grep: -A NUM, - after-context = NUM 匹配行后打印NUM行尾随上下文。