Example:
fold --spaces --width=70
-s |
[TAB] characters (x'09') are problematic.
For example:
cat 0 PID PPID COMMAND PRI TIME PRI NI 369055 369052 -jailshell 22 00:00:00 22 0 651669 369055 -jailshell 21 00:00:00 21 0In fact the spaces before the
00:
are tab characters.
hexdump -C 0 00000000 20 20 20 20 50 49 44 20 20 20 20 50 50 49 44 20 | PID PPID | 00000010 43 4f 4d 4d 41 4e 44 20 20 20 20 20 20 20 20 20 |COMMAND | 00000020 20 20 20 20 20 20 20 20 20 20 20 20 50 52 49 20 | PRI | 00000030 20 20 20 20 54 49 4d 45 20 50 52 49 20 20 4e 49 | TIME PRI NI| 00000040 0a 20 33 36 39 30 35 35 20 20 33 36 39 30 35 32 |. 369055 369052| 00000050 20 2d 6a 61 69 6c 73 68 65 6c 6c 20 20 20 20 20 | -jailshell | 00000060 20 20 20 20 20 20 20 20 20 20 20 20 20 20 32 32 | 22| 00000070 20 09 30 30 3a 30 30 3a 30 30 20 20 32 32 20 20 | .00:00:00 22 | 00000080 20 30 0a 20 36 35 31 36 36 39 20 20 33 36 39 30 | 0. 651669 3690| 00000090 35 35 20 2d 6a 61 69 6c 73 68 65 6c 6c 20 20 20 |55 -jailshell | 000000a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000000b0 32 31 20 09 30 30 3a 30 30 3a 30 30 20 20 32 31 |21 .00:00:00 21| 000000c0 20 20 20 30 0a | 0.| 000000c5See also
expand, fmt
fmt
simple text formatterfmt [-cmnps] [-d chars] [-l num] [-t num] [goal [maximum] | -width | -w width] [file ...]
A simple text formatter which reads the concatenation of input files (or standard input if none are given) and produces on standard output
a version of its input with lines as close to the goal length as possible without exceeding the maximum.
Thegoal
length defaults to 65 and the maximum to 10 more than the goal length.
Alternatively, a singlewidth
parameter can be specified either by prepending a hyphen to it or by using-w
. For example,fmt -w 72 fmt -72, and fmt 72 72
produce identical output.
The spacing at the beginning of the input lines is preserved in the output, as are blank lines and interword spacing.
Lines are joined or split only at white space; that is, words are never joined or hyphenated.
-c |
Meant to format mail messages prior to sending, fmt
is useful for other simple tasks. For instance, within visual mode of the
ex(1) editor (e.g., vi(1)) the command
!}fmtwill reformat a paragraph, evening the lines.
LANG, LC_ALL and LC_CTYPE
environment variables affect the execution of fmt as described in environ