From 080bd0e5a09a5ee9974c4d02413e70fd363b7ad3 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 3 Aug 2016 23:30:46 +1200 Subject: Add d2u(1) and u2d(1) --- README.markdown | 3 +++ bin/d2u | 9 +++++++++ bin/u2d | 10 ++++++++++ man/man1/d2u.1 | 13 +++++++++++++ man/man1/u2d.1 | 13 +++++++++++++ 5 files changed, 48 insertions(+) create mode 100644 bin/d2u create mode 100644 bin/u2d create mode 100644 man/man1/d2u.1 create mode 100644 man/man1/u2d.1 diff --git a/README.markdown b/README.markdown index e8efad5f..a9e411fd 100644 --- a/README.markdown +++ b/README.markdown @@ -309,6 +309,9 @@ Installed by the `install-bin` target: * `rnda(1)` uses `rndi(1)` to choose a random argument * `rndf(1)` uses `rnda(1)` to choose a random file from a directory * `rndl(1)` uses `rndi(1)` to choose a random line from files +* Two file formatting scripts: + * `d2u(1)` converts DOS line endings in files to UNIX ones + * `u2d(1)` converts UNIX line endings in files to DOS ones * `apf(1)` prepends arguments to a command with ones read from a file, intended as a framework for shell functions. * `ax(1)` evaluates an awk expression given on the command line; this is diff --git a/bin/d2u b/bin/d2u new file mode 100644 index 00000000..81700e15 --- /dev/null +++ b/bin/d2u @@ -0,0 +1,9 @@ +#!/bin/sh +r=$(printf '\r') +for fn ; do + ed -s -- "$fn" < diff --git a/man/man1/u2d.1 b/man/man1/u2d.1 new file mode 100644 index 00000000..48dfaeb5 --- /dev/null +++ b/man/man1/u2d.1 @@ -0,0 +1,13 @@ +.TH U2D 1 "August 2016" "Manual page for u2d" +.SH NAME +.B u2d +\- change text files from UNIX to DOS format +.SH USAGE +.B u2d FILE1 [FILE2 ...] +.SH DESCRIPTION +Applies ed(1) to change UNIX \\n line endings to DOS \\r\\n (CRLF) line +endings. Files already in DOS format should be unchanged. +.SH SEE ALSO +ed(1), d2u(1) +.SH AUTHOR +Tom Ryder -- cgit v1.2.3