このシェルスクリプト(bashなし)はどのように秒をDDD:HH:MM:SSとして表示できますか?

このシェルスクリプト(bashなし)はどのように秒をDDD:HH:MM:SSとして表示できますか?
#!/bin/sh
INTERVAL=12
TOTAL=3388888
DURSECS=$(($TOTAL * $INTERVAL))
printf "\n$DURSECS seconds.\n"
printf "\nFormatted as DAYS:HOURS:MINUTES:SECONDS - DDD:HH:MM:SS - the total duration will be:\n"
# these do not do it
# TOTALTIMES=$(($DURSECS/(24*60*60), "ddd:hh:mm:ss"))
# printf "$TOTALTIMES"
# just need days here
date -u -d @${DURSECS} +"%T"

printf '\n\nTHE END\n'

ベストアンサー1

どのくらい行くのでしょうか?

echo $((DURSECS / 86400)):$(date +%T -d@$(( DURSECS % 86400 )))
470:17:17:36

わかりますか?

おすすめ記事