[clug] file parsing strangeness

Boris Rousak b.rousak at qmul.ac.uk
Fri Jan 7 09:49:52 MST 2011


Good afternoon to all,

The problem is occurring on a VMWare vDR appliance, but this appliance 
is a Centos 5.2 for all intents and purposes, so hopefully someone can 
hit me with a clue bat :)

There is a log file on this VM called
/var/vmware/datarecovery/operations_log.utx
it is a text log. I know this is a text log because when I cat it, I get 
something like the following:

$[//]1/5/2011 3:00:14 AM: Copying 
$[19]$[*!20655,,14,+3]woodpecker$[20]$[//19/%D %.1T: Copying 
%s]$[/D/30/2011-01-05T03:00:14.000Z+00:00/]$[/T/30/2011-01-05T03:00:14.000Z+00:00/]$[/s/153/$[//]$[19]$[*!20655,,14,+3]woodpecker$[20]$[//14/$[19]%s%S$[20]]$[/s/59/$[//]$[*!20655,,14,+3]$[//15/$[*!%~d,,14,+3]]$[/d/5/20655/]/]$[/S/10/woodpecker/]/]

I can also head and tail the file. But I can't grep it. Specifically 
grep returns nothing (as if the patter doesn't match).
[root at ib ~]# grep -i copy /var/vmware/datarecovery/operations_log.utx
[root at ib ~]# cat /var/vmware/datarecovery/operations_log.utx|grep -i copy
[root at ib ~]#

same with strings
[root at ib ~]# strings /var/vmware/datarecovery/operations_log.utx
[root at ib ~]#

but awk works fine as does cut. Copying the file and changing 
permissions doesn't seem to help. Running file - gives me this:
[root at ib ~]# file /var/vmware/datarecovery/operations_log.utx
/var/vmware/datarecovery/operations_log.utx:

Can anyone suggest anything else can try do to this file to make it grep 
friendly? I'll probably end up doing the parsing using awk, but 
curiosity is getting the better of me :)

Cheers,
Boris

PS. a possibly relevant fact - the file is a bit over 2MB in size. But 
splitting into smaller files doesn't seem to help


More information about the linux mailing list