Annotation of src/usr.bin/shar/shar.1, Revision 1.9
1.9 ! jmc 1: .\" $OpenBSD: shar.1,v 1.8 2003/06/03 02:56:16 millert Exp $
1.1 deraadt 2: .\" $NetBSD: shar.1,v 1.4 1995/08/18 14:55:40 pk Exp $
3: .\"
4: .\" Copyright (c) 1990, 1993
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" Redistribution and use in source and binary forms, with or without
8: .\" modification, are permitted provided that the following conditions
9: .\" are met:
10: .\" 1. Redistributions of source code must retain the above copyright
11: .\" notice, this list of conditions and the following disclaimer.
12: .\" 2. Redistributions in binary form must reproduce the above copyright
13: .\" notice, this list of conditions and the following disclaimer in the
14: .\" documentation and/or other materials provided with the distribution.
1.8 millert 15: .\" 3. Neither the name of the University nor the names of its contributors
1.1 deraadt 16: .\" may be used to endorse or promote products derived from this software
17: .\" without specific prior written permission.
18: .\"
19: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29: .\" SUCH DAMAGE.
30: .\"
31: .\" @(#)shar.1 8.1 (Berkeley) 6/6/93
32: .\"
1.9 ! jmc 33: .Dd $Mdocdate$
1.1 deraadt 34: .Dt SHAR 1
1.4 aaron 35: .Os
1.1 deraadt 36: .Sh NAME
37: .Nm shar
38: .Nd create a shell archive of files
39: .Sh SYNOPSIS
1.3 aaron 40: .Nm shar Ar file Op Ar ...
1.1 deraadt 41: .Sh DESCRIPTION
1.3 aaron 42: .Nm shar
1.1 deraadt 43: writes an
44: .Xr sh 1
45: shell script to the standard output which will recreate the file
46: hierarchy specified by the command line operands.
47: Directories will be recreated and must be specified before the
48: files they contain (the
49: .Xr find 1
50: utility does this correctly).
51: .Pp
1.3 aaron 52: .Nm shar
1.1 deraadt 53: is normally used for distributing files by
1.6 aaron 54: .Xr ftp 1
1.1 deraadt 55: or
1.6 aaron 56: .Xr mail 1 .
1.1 deraadt 57: .Sh EXAMPLES
58: To create a shell archive of the program
1.6 aaron 59: .Xr ls 1
1.1 deraadt 60: and mail it to Rick:
61: .Bd -literal -offset indent
1.7 mpech 62: $ cd ls
63: $ shar `find . -print` \&| mail -s "ls source" rick
1.1 deraadt 64: .Ed
65: .Pp
66: To recreate the program directory:
67: .Bd -literal -offset indent
1.7 mpech 68: $ mkdir ls
69: $ cd ls
1.1 deraadt 70: \&...
71: <delete header lines and examine mailed archive>
72: \&...
1.7 mpech 73: $ sh archive
1.1 deraadt 74: .Ed
1.5 aaron 75: .Sh SEE ALSO
76: .Xr compress 1 ,
77: .Xr mail 1 ,
78: .Xr tar 1 ,
79: .Xr uuencode 1
1.1 deraadt 80: .Sh HISTORY
81: The
82: .Nm
1.3 aaron 83: command appeared in
1.1 deraadt 84: .Bx 4.4 .
1.5 aaron 85: .Sh BUGS
86: .Nm shar
87: makes no provisions for special types of files or files containing
88: magic characters.
89: .Pp
90: It is easy to insert trojan horses into
91: .Nm shar
92: files.
93: It is strongly recommended that all shell archive files be examined
94: before running them through
1.6 aaron 95: .Xr sh 1 .
1.5 aaron 96: Archives produced using this implementation of
97: .Nm shar
98: may be easily examined with the command:
99: .Bd -literal -offset indent
1.7 mpech 100: $ egrep -v '^[X#]' shar.file
1.5 aaron 101: .Ed