Commit | Line | Data |
---|---|---|
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 |
11 | if [ $# -eq 0 ]; then |
12 | echo 'usage: shar file ...' | |
13 | exit 1 | |
14 | fi | |
15 | ||
907daf7b KB |
16 | cat << 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 | # | |
24 | EOF | |
25 | ||
26 | for i | |
27 | do | |
28 | echo "# $i" | |
29 | done | |
30 | ||
31 | echo "#" | |
32 | ||
33 | for i | |
34 | do | |
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 | |
44 | done | |
45 | echo exit | |
46 | echo "" | |
bbc1f418 KB |
47 | |
48 | exit 0 |