- egrep string case
- awk '/^OAM/ { next } /Not Running[ t]*$/{s++} END {print s, NR-s-1}' foo.txt
- $ grep -v 'OAM' input | grep -cP '(?<!Not) Runnings*$'
- 6
- $ grep -v 'OAM' input | grep -cP 'Not Runnings*$'
- 1
- sed '{
- 1 d
- s/^[^:]*:[0-9]*[ ]*//
- s/^[^]]*]//
- s/^[ ]*//
- }' input_file | sort | uniq -c
- grep -P '^(?!OAM:0).*Running' temp | cut -f2 | wc -l