Afficher un message
Vieux 29/05/2007, 00h59   #1
Madhusudhanan Chandrasekaran
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Discrepancy while reading and comparing binary files

Hi,

I have a script readbinary.sh with the following three lines

#!/bin/bash
var=`cat binaryfile`
echo $var

but if I run the file readbinary.sh > trial and do a diff

vimdiff trial binaryfile they are not the same. Moreover the
size of the two files are not the same.This is the case even
if I modify the script to read line by line. This prompts me
to think that shell variables have some pre-specified size.

Also, the discrepancy in the start of the two files binaryfile
and trial is even more baffling.

Please advise where I might be going wrong.

Thanks in advance
_Madhu
  Réponse avec citation
 
Page generated in 0,04831 seconds with 9 queries