continuously_count_lines.sh 742 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env bash
  2. STARTED_COUNT=0
  3. COMPLETED_COUNT=0
  4. while [[ true ]]; do
  5. {
  6. read FOO1 FOO2 FOO3 TYPE FOO5
  7. if [[ $TYPE == "request_read_and_idx" ]]; then
  8. {
  9. STARTED_COUNT=$((STARTED_COUNT + 1))
  10. if [[ $(($STARTED_COUNT % 100)) -eq 0 ]]; then
  11. echo "" >>/OVERPASS_DB_DIR/started_count.dot # adapt directory
  12. else
  13. echo -n "." >>/OVERPASS_DB_DIR/started_count.dot # adapt directory
  14. fi
  15. }
  16. elif [[ $TYPE == "read_finished" ]]; then
  17. {
  18. COMPLETED_COUNT=$((COMPLETED_COUNT + 1))
  19. if [[ $(($COMPLETED_COUNT % 100)) -eq 0 ]]; then
  20. echo "" >>/OVERPASS_DB_DIR/completed_count.dot # adapt directory
  21. else
  22. echo -n "." >>/OVERPASS_DB_DIR/completed_count.dot # adapt directory
  23. fi
  24. }; fi
  25. }; done