Given this file$ cat hello.txthello doge worldI would like to remove a range of bytes to end up with this$ cat hello.txtheorldI would like to do this with dd if possible. The reason is because I amalready using dd to overwrite bytes in this mannerprintf '\x5E' | dd conv=notrunc of=hello.txt bs=1 seek=$((0xE))I prefer to write back to the same file, but a different output file would beokay.
dd remove range of bytes
shell script;dd
It is a matter of specifying blocksize, count, and skip:$ cat hello.txthello doge world$ { dd bs=1 count=2 ; dd skip=3 bs=1 count=1 ; dd skip=6 bs=1 ; } <hello.txt 2>/dev/nullhe orldThe above uses three invocations of dd.  The first gets the first two characters he.  The second skips to the end of hello and copies the space which follows.  The third skips into the last word world copying all but its first character.This was done with GNU dd but BSD dd looks like it should work also.