aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-04 12:18:12 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-04 12:18:12 +1200
commit4f34f5775ceb813feb395f13e5c5fd7b69e51b9d (patch)
treec5d9819a9cfeb7ed0886e7f053f1259c76ed7d1a /bin
parentAdd issue about binscripts (diff)
downloaddotfiles-4f34f5775ceb813feb395f13e5c5fd7b69e51b9d.tar.gz
dotfiles-4f34f5775ceb813feb395f13e5c5fd7b69e51b9d.zip
Consistent input checking for ed(1) scripts
Diffstat (limited to 'bin')
-rwxr-xr-xbin/stbl2
-rwxr-xr-xbin/stws3
2 files changed, 3 insertions, 2 deletions
diff --git a/bin/stbl b/bin/stbl
index 546349a0..7b1b1d2c 100755
--- a/bin/stbl
+++ b/bin/stbl
@@ -1,7 +1,7 @@
#!/bin/sh
# Strip a trailing blank line from the given files with ed(1)
if [ "$#" -eq 0 ] ; then
- printf 2>&1 'stbl: Need at least one file to edit\n'
+ printf 2>&1 'stbl: Need a filename\n'
exit 2
fi
for fn ; do
diff --git a/bin/stws b/bin/stws
index 1514a979..a955d022 100755
--- a/bin/stws
+++ b/bin/stws
@@ -1,7 +1,8 @@
#!/bin/sh
# Strip trailing spaces on one or more files
if [ "$#" -eq 0 ] ; then
- printf >&2 'tstf: Need filenames\n'
+ printf >&2 'tstf: Need a filename\n'
+ exit 2
fi
for fn ; do
ed -s -- "$fn" <<'EOF'