About Fmt ¶
fmt라는 유닉스 프로그램은 텍스트를 읽어온 다음 적당히 연결하거나 끊어서 모든 행의 길이가 72글자는 넘지 않지만 최대한 72글자에 가까운 출력 파일을 만들어낸다. 행을 연결하거나 끊을 때는 다음과 같은 규칙을 따른다.
{{|
입력 텍스트에 탭 문자는 없다고 가정해도 된다.
{{|
- 입력에 공백이 있으면 어디서든지 새로운 줄을 시작할 수 있다. 새로운 줄이 시작되면 앞 줄의 맨 뒤 및 줄의 맨 앞에 있는 공백은 모두 제거된다.
- 입력된 줄바꿈 문자 가운데 (1) 빈 줄 또는 공백만 들어있는 줄 끝에 있는 것과 (2) 그 뒤에 스페이스 또는 다른 줄바꿈 문자가 있는 것을 제외한 모든 줄바꿈 문자는
- 출력되는 줄의 맨 뒤에 있는 스페이스는 모두 삭제된다.
- 72글자가 넘는 단어가 있으면 한 줄에 그 단어 하나만 출력한다.
입력 텍스트에 탭 문자는 없다고 가정해도 된다.
Sample Input ¶
{{|
The unix fmt program reads lines of text, combining
and breaking lines so as to create an
output file with lines as close to without exceeding
72 characters long as possible. The rules for combining and breaking
lines are as follows.
If a new line is started, there will be no trailing blanks at the
end of the previous line or at the beginning of the new line.
it is not followed by a space or another line break. If a line
break is eliminated, it is replaced by a space.
|}}
Unix fmt
and breaking lines so as to create an
output file with lines as close to without exceeding
72 characters long as possible. The rules for combining and breaking
lines are as follows.
- A new line may be started anywhere there is a space in the input.
end of the previous line or at the beginning of the new line.
- A line break in the input may be eliminated in the output, provided
break is eliminated, it is replaced by a space.
|}}
Sample Output ¶
{{|
The unix fmt program reads lines of text, combining and breaking lines
so as to create an output file with lines as close to without exceeding
72 characters long as possible. The rules for combining and breaking
lines are as follows.
If a new line is started, there will be no trailing blanks at the end of
the previous line or at the beginning of the new line.
provided it is not followed by a space or another line break. If a line
break is eliminated, it is replaced by a space.
|}}
Unix fmt
so as to create an output file with lines as close to without exceeding
72 characters long as possible. The rules for combining and breaking
lines are as follows.
- A new line may be started anywhere there is a space in the input.
the previous line or at the beginning of the new line.
- A line break in the input may be eliminated in the output,
break is eliminated, it is replaced by a space.
|}}