Quote:
Originally Posted by mexxe
and now I wont to send it like an email but in minutes.
|
What do you mean by that? You want to wait some minutes and then send an email? You want to send an email expressing the number of $SECONDS in minutes?
Is it the sending of an email which is the part you don't understand, or how to get a string containing a human-readable number of minutes which is problematic, or both?
You can mail using the command line mail program, or mailx. See the manual page for syntax, it's pretty straight forward, but here's an example:
Code:
echo "You message body here" |mailx -s "subject line" recipient@address.here
To get the number of minutes, divide by 60
If you just want an integer number of minutes, you could use this:
Code:
MINUTES=$(( $SECONDS / 60 ))
However, this will round down. So you might want to append the number of SECONDS mod 60. printf will prevent the seconds not having a leading 0 when you have less than 10 seconds.
Code:
MINUTES=$( printf "%d:%02d\n" $(($SECONDS / 60)) $(( $SECONDS % 60)) )