I have a script which renders timestamps in the format YYYY'DDD'TTT where Y = year, D = day out of 365 and T = time in 1000th's of the day:
#!/bin/bash
clear
s=$(($(date +"%H*3600+%M*60+%S")))
t=$(($s * 5 / 432))
d=$(date +%j)
y=$(date +%Y)
printf "$y\`$d\`$t" "$y" "$d" "$t"
but I need to modify it so that D and T will always produce a three-character value (ie, '001' instead of '1' for Jan 1, '001' instead of '1' for the first minute of the day) - and I have no idea how.
Any help is hugely appreciated