From cd8e9cc27f7dd9d360b64f4a34b8c2d048f42e45 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 3 Nov 2017 13:46:30 +1300 Subject: Apply simpler method for sd2u(1df) and su2d(1df) This method is shorter, easier to read, and more idiomatic. --- bin/sd2u.awk | 6 +++--- bin/su2d.awk | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'bin') diff --git a/bin/sd2u.awk b/bin/sd2u.awk index 02584952..b6e3da89 100644 --- a/bin/sd2u.awk +++ b/bin/sd2u.awk @@ -1,3 +1,3 @@ -# Convert DOS line endings to UNIX ones -{ sub(/\r$/, "") } -{ print } +# Convert stream DOS line endings to UNIX ones +BEGIN { RS = "\r\n" } +1 diff --git a/bin/su2d.awk b/bin/su2d.awk index 34a8c5ae..5a8eabaf 100644 --- a/bin/su2d.awk +++ b/bin/su2d.awk @@ -1,3 +1,3 @@ -# Convert UNIX line endings to DOS ones -!/\r$/ { $0 = $0 "\r" } -{ print } +# Convert stream UNIX line endings to DOS ones +BEGIN { ORS = "\r\n" } +1 -- cgit v1.2.3