/tests/logviewer/get_messages.sh

http://github.com/hhughes/ocaml-frui · Shell · 27 lines · 23 code · 3 blank · 1 comment · 3 complexity · 21540a4b8dcfff0625395c77627f5275 MD5 · raw file

  1. #!/bin/sh
  2. N=$1
  3. if [ -z $N ]
  4. then
  5. N=1000
  6. fi
  7. echo \[
  8. X=0
  9. while [ "$X" -lt "$N" ]
  10. do
  11. M=""
  12. while [ -z "$M" ]
  13. do
  14. M=`wget -qO- http://localhost:8080/next_msg | sed '1d' | sed '$d' | sed s/\"/\'/g`
  15. done
  16. echo "$M,"
  17. C=$(( `echo "$M"|wc -l` / 8 ))
  18. X=$(( $X + $C ))
  19. #echo $C
  20. #echo $X
  21. sleep .25
  22. done
  23. echo \]