Centos / Linux Bash
I have a log file in which there are a lot of text and epoch-making numbers all over the place. I want to replace all eras if they are in a readable date / time.
I would like to get this through sed, as this seems like a tool to work with. It seems I cannot get the replacement part of sed to actually analyze the variable (era) for the conversion.
An example of what I'm working with ...
echo "Some stuff 1346474454 And not working" \
| sed 's/1[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/'"`bpdbm -ctime \&`"'/g'
Some stuff 0 = Thu Jan 1 01:00:00 1970 And not working
The bpdbm ββpart converts the given epoch variable to a usable date. Like this..
bpdbm -ctime 1346474454
1346474454 = Sat Sep 1 05:40:54 2012
So, how do I get the element "found", which will understand the team. Like I can't seem to get it to work.
Any help would be wonderful. If there is another way, that would be cool ... but I suspect sed will be the fastest.
!