how to sed from grep output in c shell? (转载)# Programming - 葵花宝典
A*a
1 楼
【 以下文字转载自 Linux 讨论区 】
发信人: Ataraxia (静), 信区: Linux
标 题: how to sed from grep output in c shell?
发信站: BBS 未名空间站 (Fri Jan 25 11:45:51 2008)
by using
foreach i (*.txt)
grep -o 'Modules:[0-9]' $i
end
i got return like
Modules:2
Modules:1
Modules:10
Modules:0
Modules:7
...
I want to cut off "Modules:" and only keep the integer number, how should i
use sed based on this output?
grep ... | sed
or
sed ... $(grep...)
Thanks.
发信人: Ataraxia (静), 信区: Linux
标 题: how to sed from grep output in c shell?
发信站: BBS 未名空间站 (Fri Jan 25 11:45:51 2008)
by using
foreach i (*.txt)
grep -o 'Modules:[0-9]' $i
end
i got return like
Modules:2
Modules:1
Modules:10
Modules:0
Modules:7
...
I want to cut off "Modules:" and only keep the integer number, how should i
use sed based on this output?
grep ... | sed
or
sed ... $(grep...)
Thanks.