ref: a517f900e434756d65b083fdfc744cf3c85ebb46
parent: 350f40300cb2126ab1d701bb1cf21841cc930fce
author: Anthony J. Bentley <[email protected]>
date: Fri Aug 30 19:11:28 EDT 2019
Use POSIX-compatible dd(1) instead of head -c.
--- a/test/asm/test.sh
+++ b/test/asm/test.sh
@@ -18,7 +18,7 @@
bin=${i%.asm}.out.bin
if [ -f $bin ]; then
../../rgblink -o $gb $o > $after 2>&1
- head -c $(wc -c < $bin) $gb > $after 2>&1
+ dd if=$gb count=1 bs=$(printf %s $(wc -c < $bin)) > $after 2>/dev/null
hexdump -C $after > $before && mv $before $after
hexdump -C $bin > $before
diff -u $before $after
--- a/test/link/test.sh
+++ b/test/link/test.sh
@@ -12,7 +12,7 @@
$RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
diff bank-numbers.out $outtemp
rc=$(($? || $rc))
-head -c 20 $gbtemp > $otemp 2>&1
+dd if=$gbtemp count=1 bs=20 > $otemp 2>/dev/null
diff bank-numbers.out.bin $otemp
rc=$(($? || $rc))
--- a/test/link/update-refs.sh
+++ b/test/link/update-refs.sh
@@ -7,7 +7,7 @@
$RGBASM -o $otemp bank-numbers.asm
$RGBLINK -o $gbtemp $otemp > bank-numbers.out 2>&1
-head -c 20 $gbtemp > bank-numbers.out.bin 2>&1
+dd if=$gbtemp count=1 bs=20 > bank-numbers.out.bin 2>/dev/null
$RGBASM -o $otemp section-attributes.asm
$RGBLINK -l section-attributes.link \