I want to generate a textual timestamp in the unix shell with microsecond accuracy, without using the
%N date option (I am using busybox, a smaller unix toolset that does not have this option), to prefix to output I am generating. The timestamp should have the format
"<seconds since epoc>.<microseconds>".
awk -f ./myawkscript.awk < /param | sed 's/$/\[<TIMESTAMP WOULD GO HERE>].'
So the desired output would look like:
[1305638345.123456] awk script output
I can obtain the epoc easy enough using
date +"%s", so my question is, is there a way of obtaining the microseconds from the shell?