shell editor

Linux for blind general discussion blinux-list at
Tue Sep 26 15:37:15 UTC 2017

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 script and a math test on the edited file 
to ensure character limit entered by user is not exceeded in a little 
Cut here.

#!/usr/bin/env bash
# file: - file with character limit script.
echo -c "character limit for file:"
echo -c "file name to edit"
truncate -s $lim $ef
tr "\0" "." < $ef > $ef.f
mv $ef.f $ef
fold -80 < $ef > $ef.f
mv $ef.f $ef
echo "remember only change lines in $ef to stay inside character limits."
nano $ef
wc -c $ef


More information about the Blinux-list mailing list