aboutsummaryrefslogtreecommitdiff
path: root/bin/d2u
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-04 09:57:57 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-04 09:57:57 +1200
commitf5a9f3a72dbbdb2240025114a5e9425767d16bc2 (patch)
tree3aee09f705f9f185909642d0b769231398f31d24 /bin/d2u
parentMake d2u(1) and u2d(1) executable (diff)
downloaddotfiles-f5a9f3a72dbbdb2240025114a5e9425767d16bc2.tar.gz
dotfiles-f5a9f3a72dbbdb2240025114a5e9425767d16bc2.zip
Make d2u(1) and u2d(1) error out on no args
Diffstat (limited to 'bin/d2u')
-rwxr-xr-xbin/d2u4
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/d2u b/bin/d2u
index 81700e15..a2cb913a 100755
--- a/bin/d2u
+++ b/bin/d2u
@@ -1,4 +1,8 @@
#!/bin/sh
+if [ "$#" -eq 0 ] ; then
+ printf >&2 'd2u: Need a filename\n'
+ exit 2
+fi
r=$(printf '\r')
for fn ; do
ed -s -- "$fn" <<EOF || ex=1