Is there a way to get Unix Time with nanoseconds with strftime in bash?
My line for unix time:
<command> | awk '{ print strftime("%s"), $0; }'
I cannot use date +% N because the date is evaluated only once.
Is there any work?
I found a workaround while reading. date is updated in this way. No need for strftime.
<command> | while read line; do d=`date +%s%N`; echo $d $line; done
You can still use date
date
ls | xargs -IQ date "+%s.%N Q"
It’s just that you don’t have% in your output ... (but you can get around this too)
Source: https://habr.com/ru/post/1758284/More articles:PHP ASP equivalent print_r - variablesEclipse: Debug script that expects command line options - pythonError displaying OpenGL texture - c ++How can I access user-installed keys and certificates from my Android app? - androidЛучший способ объявить эту огромную структуру? - cAny good WPF debuggers / inspectors for VS 2010? - wpfMySQL: Get Root Node of Parent Child Structure - sqlSQL query query - loop - sqlHow to load only the markers that are currently visible on the screen (Google maps on Android) - androidProblem with SQL stored procedure - problem with decimal value conversion - sqlAll Articles