From 41ad303ad1c2812ebe00d8880d136ad3ab44d5ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Thu, 20 May 2021 03:08:12 +0200 Subject: Add 'ft' utility --- ft | 8 ++++++++ ft.1 | 27 +++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 ft create mode 100644 ft.1 diff --git a/ft b/ft new file mode 100755 index 0000000..cc40806 --- /dev/null +++ b/ft @@ -0,0 +1,8 @@ +#!/bin/sh + +# ft -- fmt with new line for each sentence + +fmt "$@" | +sed 's/\([^ ]\)\. \([^ ]\)/\1.\n\.temporary line for fmt\n\2/g' | +fmt "$@" | +sed '/^\.temporary line for fmt$/d' diff --git a/ft.1 b/ft.1 new file mode 100644 index 0000000..6ddfd86 --- /dev/null +++ b/ft.1 @@ -0,0 +1,27 @@ +.Dd $Mdocdate$ +.Dt ft 1 +.Os +. +.Sh NAME +.Nm ft +.Nd fmt but with new sentence on new line +. +.Sh SYNOPSIS +.Nm ft +.Op Ar arg ... +. +.Sh DESCIPTION +.Pp +.Nm +runs +.Xr fmt 1 +with any given +.Ar arg +in a way such that each new sentence begins on a new line. +Sentence breaks are recognized if the period in the original text +is followed by two spaces or a newline. +.Sh AUTHORS +.Pp +.Nm +is written by John Ankarström +.Aq Mt john (at) ankarstrom.se . -- cgit v1.2.3