Mailinglist Archive: opensuse (1470 mails)

< Previous Next >
Re: [opensuse] What is the meaning of these firewall log entries?
On 02/13/2016 07:50 PM, Carlos E. R. wrote:
I need to code something first. I need a pipe that receives
text entries, and writes them to stdout prefixed with a timestamp.

http://stackoverflow.com/q/21564/4421

I'd personally probably prefer an awk solution:

$ { echo hello ; sleep 3 ; echo world; } \
| stdbuf -oL awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0 }'
2016-02-14 01:29:35 hello
2016-02-14 01:29:38 world

Have a nice day,
Berny
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups