Hello how can I write n bytes from one file into a new file starting from the k position using Bash?
- For example if n=60, k=1 and file size=100 then: the 2nd file would consist of from the 1st byte up to the 60th byte and would be 60 bytes in size
- For example if n=40, k=61 and file size=100 then: the 2nd file would consist of from the 61st byte up to the 100th byte and would be 40 bytes in size
Possibly we are working with binary files not ASCII files, so the concatenation of 2 halves should be identical to the original file!
(Is it possible with dd ?)