this needs testing

Linux for blind general discussion blinux-list at redhat.com
Mon Sep 25 22:49:48 UTC 2017


I forgot three lines in earlier version.
This one uses fold to force creation of 80 character lines making it 
easier to edit rather than just leaving a single line in the file and that 
happens before editing of file can happen.

cut here.
#!/usr/bin/env bash
# file: fcl.sh - file with character limit script.
echo -c "character limit for file:"
read
lim=$REPLY
echo -c "file name to edit"
read
ef=$REPLY
truncate --size=$lim $ef
fold $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