【发布时间】:2013-04-05 10:23:06
【问题描述】:
假设我有一个BCFile,其内容如下:
inlet
{
type fixedValue;
value uniform (5 0 0);
}
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
....
blahblahblah (other boundary condition with the same dictionary format as above)
为了打印出outlet边界条件的类型,也就是inletOutlet,我以为可以用,
cat BCFile | grep "type" | awk '{printf $2}' | tr -d ";"
但现在的问题是在使用grep 时出现了很多type 关键字。那么有没有办法先检测到outlet这个词,然后搜索和grep{}之间的内容呢?谢谢!
【问题讨论】: