BlogBlog ÜbersichtjailscriptportsoptFreeBSDLinksThermoskanne

Zeilenlänge von Texten limitieren

fmt(1) formatiert Textdateien so, dass standardmässig eine Zeile aus 65, maximal jedoch aus 75 Zeichen besteht.

# more freebsd
FreeBSD® is an advanced operating system for x86 compatible (including Pentium® and Athlon), amd64 compatible (including Opteron, Athlon64, and EM64T), UltraSPARC®, IA-64, PC-98 and ARM architectur
es. It is derived from BSD, the version of UNIX® developed at the University of California, Berkeley. It is developed and maintained by a large team of individuals. Additional platforms are in vari
ous stages of development.
# fmt freebsd
FreeBSD® is an advanced operating system for x86 compatible (including
Pentium® and Athlon), amd64 compatible (including Opteron, Athlon64,
and EM64T), UltraSPARC®, IA-64, PC-98 and ARM architectures. It is
derived from BSD, the version of UNIX® developed at the University
of California, Berkeley. It is developed and maintained by a large
team of individuals. Additional platforms are in various stages of
development.

Die Anzahl Zeichen pro Zeile kann auch selber bestimmt werden:

# fmt <Optimale Anzahl Zeichen> <Maximale Anzahl Zeichen> <Textdatei>

Es kann auch nur eine maximale Anzahl Zeichen angegeben werden:

# fmt -w <Maximale Anzahl Zeichen> <Textdatei>

So kann man zum Beispiel eine pkg-descr auf 80 Zeichen pro Zeile beschränken:

# fmt -w 80 pkg-descr.raw > pkg-descr
 Permalink