summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authoritojun <itojun@FreeBSD.org>1997-08-29 00:44:34 +0000
committeritojun <itojun@FreeBSD.org>1997-08-29 00:44:34 +0000
commit6ebf25c91cce99a1df5b7f505110ccac57ac9419 (patch)
tree6a95dd7c775e3207f8b2da80b6660056aa39d726 /usr.bin
parentbaf2d6ffb6bcb6bd8d3e180475de9b08b94d5c89 (diff)
downloadFreeBSD-src-6ebf25c91cce99a1df5b7f505110ccac57ac9419.zip
FreeBSD-src-6ebf25c91cce99a1df5b7f505110ccac57ac9419.tar.gz
more sanity check before making output.
bark when sed fails. Submitted by: wosch@apfel.de
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/shar/shar.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/shar/shar.sh b/usr.bin/shar/shar.sh
index f38d92b..bf541c0 100644
--- a/usr.bin/shar/shar.sh
+++ b/usr.bin/shar/shar.sh
@@ -41,8 +41,8 @@ fi
for i
do
- if [ ! -e $i ]; then
- echo "$i does not exist" 1>&2
+ if [ ! \( -d $i -o -r $i \) ]; then
+ echo "$i inaccessible or not exist" 1>&2
exit 66 # EX_NOINPUT
fi
done
@@ -72,7 +72,7 @@ do
else
echo "echo x - $i"
echo "sed 's/^X//' >$i << 'END-of-$i'"
- sed 's/^/X/' $i
+ sed 's/^/X/' $i || exit
echo "END-of-$i"
fi
done
OpenPOWER on IntegriCloud