Script and Comments
Script1 [ 1] /^$/b
[ 2] :loop
[ 3] /^.\{31\}/!{
[ 4] /\n$/b
[ 5] $q
[ 6] N
[ 7] b loop
[ 8] }
[ 9] s/\n/ /g
[10] s/^\(.\{1,30\}\) /\1\n /
[11] s/^\(.\{1,29\}\)\n /\1 \n/
[12] /\n/!s/ /\n /
[13] P
[14] D
| |
| Raw Input
| This is a test file to see whether the proposed
sed script can correctly format this file based on paragraphs.
Every line of the output consists of no more than
30 characters.
Linux becomes popular as time passes. I first met Linux
in August, 1993. At that time, Linux was not user-friendly
at all. Although it has GUI environment, but it is not
fantastic at all.
Nowadays, there are several projects developing GUI programs
on Linux system: GNOME and KDE. They provides many useful
and good-looking tools.
|
|
| Desired Output
| This is a test file to see
whether the proposed sed
script can correctly format
this file based on paragraphs.
Every line of the output
consists of no more than 30
characters.
Linux becomes popular as time
passes. I first met Linux in
August, 1993. At that time,
Linux was not user-friendly at
all. Although it has GUI
environment, but it is not
fantastic at all.
Nowadays, there are several
projects developing GUI
programs on Linux system:
GNOME and KDE. They provides
many useful and good-looking
tools.
|
|