I have seen the other examples and posts but just can't seem to get this working. I have some lparstat output which looks like:
Partition Number : 1
Type : Dedicated-SMT
Mode : Capped
Entitled Capacity : 4,00
Partition Group-ID : 32769
Shared Pool ID : -
I would like to get the Capped value.
I have the following command however need to elimanate the leading whitespace:
cat lparstat.out | egrep '^Mode' | awk -F: '{ print $2 }'
Any suggestion on how to modify the awk command appreciated. I don't want to pipe to sed.
awk -F ' *: ' '$1=="Mode"{print $2}' lparstat.out
or with a regex:
awk -F ': ' '/^Mode/{print $2}' lparstat.out
Output:
Capped
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With