date and time created 91/01/17 18:23:46 by bostic
[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#
6# %sccs.include.redist.sh%
7#
bbc1f418 8# @(#)shar.sh 5.2 (Berkeley) %G%
907daf7b
KB
9#
10
bbc1f418
KB
11if [ $# -eq 0 ]; then
12 echo 'usage: shar file ...'
13 exit 1
14fi
15
907daf7b
KB
16cat << EOF
17# This is a shell archive. Save it in a file, remove anything before
18# this line, and then unpack it by entering "sh file". Note, it may
19# create directories; files and directories will be owned by you and
20# have default permissions.
21#
22# This archive contains:
23#
24EOF
25
26for i
27do
28 echo "# $i"
29done
30
31echo "#"
32
33for i
34do
35 if [ -d $i ]; then
36 echo "echo c - $i"
37 echo "mkdir $i > /dev/null 2>&1"
38 else
39 echo "echo x - $i"
40 echo "sed 's/^X//' >$i << 'END-of-$i'"
41 sed 's/^/X/' $i
42 echo "END-of-$i"
43 fi
44done
45echo exit
46echo ""
bbc1f418
KB
47
48exit 0