#!/bin/bash # # Matthew Page # 11/20/2014 # CSCS 1730 # # timeonline - a script to caclulate number of logins # and time online. # #variables for number of logins per month auglogins=`last | grep $USER | grep Aug | wc -l` seplogins=`last | grep $USER | grep Sep | wc -l` octlogins=`last | grep $USER | grep Oct | wc -l` novlogins=`last | grep $USER | grep Nov | wc -l` declogins=`last | grep $USER | grep Dec | wc -l` totallogins=`($auglogins + $seplogins + $octlogins + $novlogins + $declogins) | bc -l` echo $auglogins echo $seplogins echo $octlogins echo $novlogins echo $declogins