On 08/12/2018 01:00 PM, Bernhard Voelker wrote:
# Create a binary testfile file with a '!BDN' marker. $ { cat /usr/bin/cat; printf '!BDN'; cat /usr/bin/cat; } > testfile
# Use awk(1) to print everything after and including the marker. awk 'BEGIN{RS="!BDN";ORS=""} {if(n++)print}' < testfile > testfile2
Or use 'grep --byte-offset --binary-files=text --only-matching --fixed-strings' to find the marker (stripping off the matched pattern after and including the ':'): $ n="$( grep -baoF '!BDN' testfile | cut -d: -f1 )" and then let dd copy all from that position: $ dd \ if=testfile \ of=testfile2-dd \ status=none \ bs=1 \ iflag=skip_bytes \ skip="$n" Have a nice day, Berny -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org