I am writing a script to display how long a user has been logged in.
who | grep "$userid" | awk '{print $1,$3,$4}' | while read user time; do \echo $(($(($(date +%s) - $(date -d "$time" +%s)))/60)) minutes; done
How can I make this display hours and minutes? As of now it only displays minutes. I need it to display, for example, 1 hour(s) and 45 minute(s) with the (s) included.