yasm/test_hd.pl
Peter Johnson e4988ea961 Make test scripts more portable by detecting echo line-ending features, using
fewer options for sed, and using a perl script for hexdump.  As a side effect,
hexdumps are more accurate (the hexdump util put * for as many multiples as
were output, whereas the perl script outputs a line for every byte, no matter
what).

svn path=/trunk/yasm/; revision=736
2002-10-04 07:23:11 +00:00

7 lines
229 B
Perl
Executable file

#! /usr/bin/env perl
open(BFILE,$ARGV[0]) || die "Could not open \\$ARGV[0]\\: $!";
while(!eof(BFILE)) {
read(BFILE, $buffer, 1);
printf("%02x \n", ord($buffer));
}
close(BFILE) || die "Could not close \\$ARGV[0]\\: $!";