#!/bin/bash # adds offset to a header value # This header is not really needed for BSU programs, # but is useful when converting to Seismic Unix codes # that require it. echo " PC linux is little endian" echo "offset is 4 byte integer in header at hex bytes 0x24 0x25 0x26 0x27" hexdump -C k007.seg |grep 00000020 echo "00000020 | | | | " echo "hexdump k007.seg: starting at hexbyte 0x20, List shows 45 00 00 00" echo "this is garbage" # BOFF computes offset header, for trace 1 this is 74 meters boff k007.seg >/dev/null hexdump -C boffk007.seg |grep 00000020 echo "00000020 | | | | " echo "hexdump boffk007.seg: shows 4a 00 00 00 " echo "garbage replaced with 0x4a = 74, correct value "The output when run is:
PC linux is little endian offset is 4 byte integer in header at hex bytes 0x24 0x25 0x26 0x27 00000020 00 00 01 00 45 00 00 00 61 90 01 00 ff 85 01 00 |....E...a.......| 00000020 | | | | hexdump k007.seg: starting at hexbyte 0x20, List shows 45 00 00 00 this is garbage 00000020 00 00 01 00 4a 00 00 00 61 90 01 00 ff 85 01 00 |....J...a.......| 00000020 | | | | hexdump boffk007.seg: shows 4a 00 00 00 garbage replaced with 0x4a = 74, correct value