4 comments

[ 3.8 ms ] story [ 11.0 ms ] thread
How does this differ from the 'fmt' utility included in the GNU textutils set?
I thought that fmt only separated text by columns not by characters or words?
You are thinking of 'col'. 'fmt' reflows paragraphs:

   NAME
       fmt - simple optimal text formatter

   SYNOPSIS
       fmt [-WIDTH] [OPTION]... [FILE]...

   DESCRIPTION
       Reformat each paragraph in the FILE(s), writing to
       standard output. The option -WIDTH is an abbreviated
       form of --width=DIGITS. Mandatory arguments to long
       options are mandatory for short options too.

       -c, --crown-margin
              preserve indentation of first two lines

       -p, --prefix=STRING
              reformat only lines beginning with STRING,
              reattaching the prefix to reformatted lines

       -s, --split-only
              split long lines, but do not refill

       -t, --tagged-paragraph
              indentation of first line different from
              second

       -u, --uniform-spacing
              one space between words, two after sentences

       -w, --width=WIDTH
              maximum line width (default of 75 columns)

       -g, --goal=WIDTH
              goal width (default of 93% of width)

       --help display this help and exit

       --version
              output version information and exit

       With no FILE, or when FILE is -, read standard input.
Oh ok.

I still can't figure out how to achieve the same functionality with fmt though. Am I doing something wrong, or does `fmt` just not provide the same functionality as `reline`?