Subj : text reformating
To : Grant Weasner
From : Maurice Kinal
Date : Mon May 19 2025 08:33 pm
Hej Grant!
----- example.text
The above example indicates that the backup.sh script should be executed every day, with a delay of 15 mins. i.e When the laptop was started, executed it only after 15 minutes.
For the above line (paragraph) this will work;
$ sed 's/^ *//' example.text | fold -sw 61 | sed 's/^/ /'
The above example indicates that the backup.sh script should
be executed every day, with a delay of 15 mins. i.e When the
laptop was started, executed it only after 15 minutes.
Note that the width is 61 characters before tacking on the indentation of three spaces. Also note that the width is characters ***NOT*** bytes.
$ trans -b -no-ansi -t ukrainian -i example.text | fold -sw 61 | sed 's/^/ /'
Наведений вище приклад вказує на те, що сценарій резервного
копіювання.Sh повинен виконуватись щодня, із затримкою 15
хвилин. тобто, коли ноутбук був запущений, виконував його
лише через 15 хвилин.
If the application you are using to read this is utf8 capable you will note that the translation is still counting 16 bit characters (Cyrillic) as one. To get fold to wrap bytes then add the -b switch to fold since the default is characters. For strictly 7 and 8 bit characters, -b and -c are the same.
Het leven is goed,
Maurice
o- o- -o o-
/) /) (\ /)
^^ ^^ ^^ ^^
... þa þurfon swiþe lytles, þe maran ne willniaþ þonne genoges.
They need very little who desire no more than enough.
--- GNU bash, version 5.2.37(1)-release (x86_64-pc-linux-gnu)
* Origin: Little Mikey's EuroPoint @ (2:280/464.113)