Say I have a BCFile having the following contents:
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)
In order to print out the type of outlet boundary condition, that is inletOutlet, I thought I could use,
cat BCFile | grep "type" | awk '{printf $2}' | tr -d ";"
But the problem now is in using grep there are so many type keyword appeared. So is there a way to first detect the word outlet, then search and grep the contents between {}? Thanks!