lib/scripts/showtime
changeset 9789 7e5e6c47c0b5
parent 4450 2c64ce912684
child 10555 2323ec838401
equal deleted inserted replaced
9788:df671fa2562a 9789:7e5e6c47c0b5
     1 #!/bin/bash
     1 #!/bin/bash
     2 #
     2 #
     3 # $Id$
     3 # $Id$
       
     4 # Author: Markus Wenzel, TU Muenchen
       
     5 # License: GPL (GNU GENERAL PUBLIC LICENSE)
     4 #
     6 #
     5 # showtime - print time.
     7 # showtime - print time.
     6 
     8 
     7 TIME=$1
     9 TIME="$1"
     8 
    10 
     9 SECS=$[ $TIME % 60 ]
    11 SECS=$[ $TIME % 60 ]
    10 [ $SECS -lt 10 ] && SECS=0$SECS
    12 [ $SECS -lt 10 ] && SECS="0$SECS"
    11 
    13 
    12 MINUTES=$[ ($TIME / 60) % 60 ]
    14 MINUTES=$[ ($TIME / 60) % 60 ]
    13 [ $MINUTES -lt 10 ] && MINUTES=0$MINUTES
    15 [ $MINUTES -lt 10 ] && MINUTES="0$MINUTES"
    14 
    16 
    15 HOURS=$[ $TIME / 3600 ]
    17 HOURS=$[ $TIME / 3600 ]
    16 
    18 
    17 echo "${HOURS}:${MINUTES}:${SECS}"
    19 echo "${HOURS}:${MINUTES}:${SECS}"