You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

blankLines 310B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. nonempty=0
  3. brackets=0
  4. empty=0
  5. while read line
  6. do
  7. if [ -z "$line" ]
  8. then
  9. ((empty++))
  10. elif [ "$line" == "{" ] || [ "$line" == "}" ]
  11. then
  12. ((brackets++))
  13. elif [ -n "$line" ]
  14. then
  15. ((nonempty++))
  16. fi
  17. done < $1
  18. echo "non-blank lines: $nonempty"