Advertisement
Guest User

Untitled

a guest
Mar 6th, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.33 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. it=10
  4.  
  5. bench () {
  6.     echo -n $1:
  7.     time for ((i = 0; i < it; i++)); do
  8.         "$@" /usr/include/{*.h,*/*.h} > /dev/null 2>&1 < /dev/null
  9.     done
  10.     echo
  11. }
  12.  
  13. bench grep -h "#include.*stdio"
  14. bench awk '/#include.*stdio/ {print}'
  15. bench sed -rn '/#include.*stdio/p'
  16. bench perl -ne 'print if /#include.*stdio/'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement