Add a --timestamp option to cat? (original) (raw)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
From: | Adam Sjøgren |
---|---|
Subject: | Add a --timestamp option to cat? |
Date: | Thu, 03 Mar 2011 21:33:23 +0100 |
User-agent: | Gnus/5.110014 (No Gnus v0.14) Emacs/24.0.50 (gnu/linux) |
Hi.
I often have programs that output stuff I would like have logged with timestamps, but they don't print timestamps themselves. I have been using various shell-scripts/hacks calling date(1) to wrap them.
I think it would be really great to be able to just go:
$ some_program | cat --timestamp > some_program.log
Rather similar to what cat --number does, only with timestamps.
I have made a little patch adding that functionality in a topic-branch called "timestamp" in my local clone of the coreutils git-repository:
(git clone http://koldfront.dk/git/coreutils will clone my repo.)
Example:
$ (echo A; sleep 2; echo B; sleep 3; echo C) | ./cat --timestamp 2011-03-03 21:30:19 A 2011-03-03 21:30:21 B 2011-03-03 21:30:24 C $ (echo A; echo B; echo C) | ./cat --number 1 A 2 B 3 C $
I was wondering whether something like this could be considered for inclusion, or if there is some other/better avenue I should pursue?
Any advice/comments/etc. welcome. Thanks!
Best regards,
Adam
-- "I always liked songs with parentheses in the title." Adam Sjøgren address@hidden
- Add a --timestamp option to cat?,Adam Sjøgren <=
- Re: Add a --timestamp option to cat?, Bob Proulx, 2011/03/03
* Re: Add a --timestamp option to cat?, Adam Sjøgren, 2011/03/03 - Re: Add a --timestamp option to cat?, Ondrej Vasik, 2011/03/03
- Re: Add a --timestamp option to cat?, Bob Proulx, 2011/03/03
- Prev by Date:Re: RFC: improved support for grouping in uniq
- Next by Date:Re: Add a --timestamp option to cat?
- Previous by thread:RFC: improved support for grouping in uniq
- Next by thread:Re: Add a --timestamp option to cat?
- Index(es):