Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function displaytime {
- local T=$1
- local D=$((T/60/60/24))
- local H=$((T/60/60%24))
- local M=$((T/60%60))
- local S=$((T%60))
- (( $D > 0 )) && printf '%d Tage ' $D
- (( $H > 0 )) && printf '%d Stunden ' $H
- (( $M > 0 )) && printf '%d Minuten ' $M
- (( $D > 0 || $H > 0 || $M > 0 )) && printf 'und '
- printf '%d Sekunden\n' $S
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement