diff options
author | John Ankarström <john@ankarstrom.se> | 2021-05-20 03:08:12 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-05-20 03:08:12 +0200 |
commit | 41ad303ad1c2812ebe00d8880d136ad3ab44d5ab (patch) | |
tree | 142e19f5962c3d3b1a615158d9b3b64663806988 | |
parent | 247f473497615712c0de1bd37549c8f799edb285 (diff) | |
download | xutil-41ad303ad1c2812ebe00d8880d136ad3ab44d5ab.tar.gz |
Add 'ft' utility
-rwxr-xr-x | ft | 8 | ||||
-rw-r--r-- | ft.1 | 27 |
2 files changed, 35 insertions, 0 deletions
@@ -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' @@ -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 . |