diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-04 09:57:57 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-04 09:57:57 +1200 |
commit | f5a9f3a72dbbdb2240025114a5e9425767d16bc2 (patch) | |
tree | 3aee09f705f9f185909642d0b769231398f31d24 /bin/d2u | |
parent | Make d2u(1) and u2d(1) executable (diff) | |
download | dotfiles-f5a9f3a72dbbdb2240025114a5e9425767d16bc2.tar.gz dotfiles-f5a9f3a72dbbdb2240025114a5e9425767d16bc2.zip |
Make d2u(1) and u2d(1) error out on no args
Diffstat (limited to 'bin/d2u')
-rwxr-xr-x | bin/d2u | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 |