假设我有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之间的内容{}
?谢谢!