#!/bin/bash # fmt--text formatting utility that acts as a wrapper for nroff # Adds two useful flags: -w X for line width # and -h to enable hyphenation for better fills. while getopts "hw:" opt { match $opt { with h setglobal hyph = '1' with w setglobal width = $OPTARG } } shift $shExpr('$OPTIND - 1') nroff << """ .ll $(width:-72) .na .hy $(hyph:-0) .pl 1 $[cat @Argv] """ exit 0