aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-03 14:19:16 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-03 14:19:16 +1300
commit6527e0d74b2d62c9fd76d6ae357227887f89c4f1 (patch)
treed542cc6f42a9d898954491e871c07441814552cc
parentMerge branch 'feature/sd2u-su2d-d...' into develop (diff)
parentMake d2u(1df)/u2d(1df) like their stream analogues (diff)
downloaddotfiles-6527e0d74b2d62c9fd76d6ae357227887f89c4f1.tar.gz
dotfiles-6527e0d74b2d62c9fd76d6ae357227887f89c4f1.zip
Merge branch 'feature/d2u-u2d-con...' into develop
* feature/d2u-u2d-consist: Make d2u(1df)/u2d(1df) like their stream analogues
-rw-r--r--bin/d2u.sh2
-rw-r--r--bin/u2d.sh3
-rw-r--r--man/man1/d2u.1df2
-rw-r--r--man/man1/u2d.1df2
4 files changed, 4 insertions, 5 deletions
diff --git a/bin/d2u.sh b/bin/d2u.sh
index 22c8e16b..892c446b 100644
--- a/bin/d2u.sh
+++ b/bin/d2u.sh
@@ -16,7 +16,7 @@ for fn ; do
# $r within it to get a literal carriage return; the escape characters
# prescribed for ed(1) by POSIX are very limited
ed -s -- "$fn" <<EOF || ex=1
-g/$r\$/ s/$r\$//
+,s/$r\$//
w
EOF
done
diff --git a/bin/u2d.sh b/bin/u2d.sh
index 9f4e800a..31030341 100644
--- a/bin/u2d.sh
+++ b/bin/u2d.sh
@@ -16,8 +16,7 @@ for fn ; do
# $r within it to get a literal carriage return; the escape characters
# prescribed for ed(1) by POSIX are very limited
ed -s -- "$fn" <<EOF || ex=1
-g/[^$r]\$/ s/\$/$r/
-g/^\$/ s/\$/$r/
+,s/\$/$r/
w
EOF
done
diff --git a/man/man1/d2u.1df b/man/man1/d2u.1df
index 18c27829..c652434c 100644
--- a/man/man1/d2u.1df
+++ b/man/man1/d2u.1df
@@ -6,7 +6,7 @@
.B d2u FILE1 [FILE2 ...]
.SH DESCRIPTION
Applies ed(1) to change DOS \\r\\n (CRLF) line endings to UNIX \\n line
-endings. Files already in UNIX format should be unchanged.
+endings.
.SH SEE ALSO
ed(1), u2d(1df), sd2u(1df), su2d(1df)
.SH AUTHOR
diff --git a/man/man1/u2d.1df b/man/man1/u2d.1df
index 3bb16092..9af792bf 100644
--- a/man/man1/u2d.1df
+++ b/man/man1/u2d.1df
@@ -6,7 +6,7 @@
.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.
+endings.
.SH SEE ALSO
ed(1), d2u(1df), sd2u(1df), su2d(1df)
.SH AUTHOR