BSD 4_3_Reno release
[unix-history] / usr / src / usr.bin / shar / shar.sh
CommitLineData
907daf7b
KB
1#!/bin/sh -
2#
3# Copyright (c) 1990 The Regents of the University of California.
4# All rights reserved.
5#
1c15e888
C
6# Redistribution and use in source and binary forms are permitted
7# provided that: (1) source distributions retain this entire copyright
8# notice and comment, and (2) distributions including binaries display
9# the following acknowledgement: ``This product includes software
10# developed by the University of California, Berkeley and its contributors''
11# in the documentation or other materials provided with the distribution
12# and in all advertising materials mentioning features or use of this
13# software. Neither the name of the University nor the names of its
14# contributors may be used to endorse or promote products derived
15# from this software without specific prior written permission.
16# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
907daf7b 19#
1c15e888 20# @(#)shar.sh 5.2 (Berkeley) 5/23/90
907daf7b
KB
21#
22
bbc1f418
KB
23if [ $# -eq 0 ]; then
24 echo 'usage: shar file ...'
25 exit 1
26fi
27
907daf7b
KB
28cat << EOF
29# This is a shell archive. Save it in a file, remove anything before
30# this line, and then unpack it by entering "sh file". Note, it may
31# create directories; files and directories will be owned by you and
32# have default permissions.
33#
34# This archive contains:
35#
36EOF
37
38for i
39do
40 echo "# $i"
41done
42
43echo "#"
44
45for i
46do
47 if [ -d $i ]; then
48 echo "echo c - $i"
49 echo "mkdir $i > /dev/null 2>&1"
50 else
51 echo "echo x - $i"
52 echo "sed 's/^X//' >$i << 'END-of-$i'"
53 sed 's/^/X/' $i
54 echo "END-of-$i"
55 fi
56done
57echo exit
58echo ""
bbc1f418
KB
59
60exit 0