KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Having a long running program that continuously writes to a logfile - how is it possible, disregarding any buffering issues, to add a date string to each line written to that file using a linux script? I would imagine something like this: tail -f logfile | ADD_DATE_TO_EACH_LINE > logfile2 The input would be something like that: abc def ghi jkl The output should be similar to that: 2011-06-16 18:30:59 abc 2011-06-16 18:31:00 def 2011-06-16 18:35:21 ghi 2011-06-16 18:40:15 jkl
Tags (comma-separated)
Save Edits
Cancel