summaryrefslogtreecommitdiff
path: root/usr.bin/shar
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@FreeBSD.org>1997-08-28 14:35:09 +0000
committerJun-ichiro itojun Hagino <itojun@FreeBSD.org>1997-08-28 14:35:09 +0000
commit53202ce57adca0cd7dd5b808c8ff024dc828a345 (patch)
treeb6af775f9925d2ef0e3d5a0dd1ce8982fa3cd5e6 /usr.bin/shar
parenta1b442d74c24d49f68791e9384065de2ef682a56 (diff)
downloadsrc-test-53202ce57adca0cd7dd5b808c8ff024dc828a345.tar.gz
src-test-53202ce57adca0cd7dd5b808c8ff024dc828a345.zip
To cope with shell archive file generated by GNU sharutils 4.2.
(it assumes that shar will bark if there's invalid argument specified) Patch suggested by Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>. Reviewed by: joerg_wunsch@uriah.heep.sax.de
Notes
Notes: svn path=/head/; revision=28871
Diffstat (limited to 'usr.bin/shar')
-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 08db22c97a0e2..f38d92b6904a5 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