[PLUG] Translating ^M to \n

Rodney W. Grimes freebsd at gndrsh.dnsmgr.net
Tue Aug 13 16:12:40 UTC 2019


> On Mon, 12 Aug 2019, Rodney W. Grimes wrote:
> 
> > dd if=oldfile bs=1 iseek=1 | tr '\r' '\n' >newfile
> 
> Rod,
> 
> The dd version here (from GNU coreutils 8.25, 2016) does not have an iseek
> option, but it does have a seek option: seek=N skip N obs-sized blocks at
> start of output.

iseek is the same as skip, so:

dd if=oldfile bs=1 skip=1 | tr '\r' '\n' >newfile

> However, when I run that:

Please always paste your exact command, it is missing from here, but
I suspect it was:
	dd if=oldfile bs=1 seek=1 | tr '\r' '\n' >newfile
And yes, that is going to generate an error as it did:

> 
> dd: 'standard output': cannot seek: Illegal seek
> 0+0 records in
> 0+0 records out
> 0 bytes copied, 7.0422e-05 s, 0.0 kB/s
> 
> Do I need that option?

Change iseek -> skip, not to seek, seek in gnu dd is == oseek.
And yes, that is the option that kills the first byte of the file.


-- 
Rod Grimes                                                 rgrimes at freebsd.org



More information about the PLUG mailing list