#! /bin/sh jsdoc2 -T | tee /tmp/logfile failures=$(grep "NOT OK " /tmp/logfile | wc -l) tests=$(grep "... OK " /tmp/logfile | wc -l) test 1 -eq $(echo "$failures < 0.05 * $tests" | bc)