summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/shar/shar.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/shar/shar.sh b/usr.bin/shar/shar.sh
index 08db22c..f38d92b 100644
--- a/usr.bin/shar/shar.sh
+++ b/usr.bin/shar/shar.sh
@@ -35,10 +35,18 @@
#
if [ $# -eq 0 ]; then
- echo 'usage: shar file ...'
- exit 1
+ echo 'usage: shar file ...' 1>&2
+ exit 64 # EX_USAGE
fi
+for i
+do
+ if [ ! -e $i ]; then
+ echo "$i does not exist" 1>&2
+ exit 66 # EX_NOINPUT
+ fi
+done
+
cat << EOF
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
OpenPOWER on IntegriCloud