Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- $uptime = `cat /proc/uptime | awk '{print $1}';`;
- $boot = time() - $uptime;
- chomp $boot;
- while (<STDIN>) {
- if ($_ =~ /^\[([\s\d\.]+)\]/) {
- $time_offset = $1;
- }
- $real_time = sprintf scalar localtime($boot + $time_offset);
- $_ =~ s/\[[\s\d\.]+\]/\[$real_time\]/;
- print $_;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement