bash: how to wrap or fold long lines at specified punctuations only?

Viewed 70

I understand fold could wrap long lines with a column/width limit, and also an option -s to do so only at spaces.

fold -w20 -s input_file

But is there a way to restrict the line length and also only wrap at specified punctuations, like , . ! ? etc.? This would generate more readable lines.

0 Answers
Related