Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. abc abb cabby
  2.  
  3. grep -E "[abc]" test.txt | wc -l
  4.  
  5. grep 'abcdef' testCount.txt | wc -l
  6.  
  7. $ echo "abc abb cabby" |
  8. awk '{
  9. for(i=1;i<=NF;i++)
  10. if(sub(/a/,"",$i)>0 && sub(/b/,"",$i)>0 && sub(/c/,"",$i)>0) {
  11. count+=1
  12. }
  13. }
  14. END{print count}'
  15. 2
  16.  
  17. <file grep -ow 'w+' | grep a | grep b | grep c
  18.  
  19. abc
  20. cabby
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement