My issue is, when the script needs to give a longer text output, it is a mess to manually code that so that no word is cut at the end of line and the rest of that one word is displayed on the next line, instead a nice word wrap is what I (once again) am looking for.
And when one would forcefully and manually pre-wrap the text in the script it would be a waste of space on the right of the terminal if the term $COLUMNS the script runs in is larger that 80 - or if it is less than 80 the text output would still be just cut at the end of lines.
I know there are many ways in archiving this, but for some reason even after long duckduckgo'ing I found nothing that would do what I want and work in both sh or bash, if it only works in bash that would be okay, too.
I hope I made myself clear what I am looking for:
just like the text above, and text in any decent editor when "word wrap" is activated, the words get automatically moved into the next line when the word at the end of a line does not fit into that line.
Here is an example. The info line is a bit longer:
Code: Select all
echo I will also activate the needed dependencies libjpeg.so.8.xzm and libtiff.so.5.xzm . Press enter to continue, or Ctrl+C to abort.
Code: Select all
I will also activate the needed dependencies libjpeg.so.8.xzm and libtiff.so.5.x
zm . Press enter to continue, or Ctrl+C to abort.
Code: Select all
I will also activate the needed dependencies libjpeg.so.8.xzm and
libtiff.so.5.xzm . Press enter to continue, or Ctrl+C to abort.
Is it possible to archive that via fold when using a here document? Unfortunately I am not that well versed in the use of here documents. So I would need some tips from you folks.