Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: None  |  size: 0.36 KB  |  hits: 5  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. egrep string case
  2. awk '/^OAM/ { next } /Not Running[ t]*$/{s++} END {print s, NR-s-1}' foo.txt
  3.        
  4. $ grep -v 'OAM' input | grep -cP '(?<!Not) Runnings*$'
  5. 6
  6.        
  7. $ grep -v 'OAM' input | grep -cP 'Not Runnings*$'
  8. 1
  9.        
  10. sed '{
  11. 1 d
  12. s/^[^:]*:[0-9]*[ ]*//
  13. s/^[^]]*]//
  14. s/^[ ]*//
  15. }' input_file | sort | uniq -c
  16.        
  17. grep -P '^(?!OAM:0).*Running' temp | cut -f2 | wc -l