lib/scripts/showtime
author wenzelm
Fri, 01 Sep 2000 17:54:58 +0200
changeset 9789 7e5e6c47c0b5
parent 4450 2c64ce912684
child 10555 2323ec838401
permissions -rwxr-xr-x
GPLed; more robust handling of spaces in args / file names;

#!/bin/bash
#
# $Id$
# Author: Markus Wenzel, TU Muenchen
# License: GPL (GNU GENERAL PUBLIC LICENSE)
#
# showtime - print time.

TIME="$1"

SECS=$[ $TIME % 60 ]
[ $SECS -lt 10 ] && SECS="0$SECS"

MINUTES=$[ ($TIME / 60) % 60 ]
[ $MINUTES -lt 10 ] && MINUTES="0$MINUTES"

HOURS=$[ $TIME / 3600 ]

echo "${HOURS}:${MINUTES}:${SECS}"