This isn't what was requested, but I'm pretty certain it will be useful
nonetheless. The truncate command can create a file and make it a
specific number of characters in size. Truncation happens from the end of
the file if too large. So truncate 1 file.txt would make a file 1
charac
The truncate command will likely have an undesired side-effect: if the
file is smaller than the target size, it will be generally be padded with
binary zeroes to force it to be the specified size.
If pure truncation is desired, might I suggest the dd command instead:
dd if=input-file of=output-f
Thanks, those binary zeros in that context could cause a real mess.
On Tue,
26 Sep 2017, Linux for blind general discussion wrote:
Date: Tue, 26 Sep 2017 00:10:43
From: Linux for blind general discussion
To: Linux for blind general discussion
Subject: Re: shell editor
The truncate command
for blind general discussion wrote:
Date: Tue, 26 Sep 2017 07:01:52
From: Linux for blind general discussion
To: Linux for blind general discussion
Subject: Re: shell editor
Thanks, those binary zeros in that context could cause a real mess.
On Tue, 26 Sep 2017, Linux for blind general discus
No, fmt is not the same as fold. The fmt command in my testing failed to
break lines but fold got the line breaks correct.
Also, truncate is back along with the tr command to change those binary
zeros to spaces. Easier approach. This one so far as I can tell now
works. I'll put a loop in the