The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.
I want to count all the lines that begin with a valid date. This code works if a line begins with a valid date but if it does not then it returns an error.
#!/bin/bash NOW=$( date +"%s" ) while read MONTH DAY TIME DATA do THEN=$( date -d "$MONTH $DAY $TIME" +"%s" ) COUNT=$((COUNT+1)) done < $1 echo $COUNT