xref: /original-bsd/usr.bin/shar/shar.1 (revision c471a344)
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)shar.1	5.3 (Berkeley) 04/21/91
7.\"
8.Dd
9.Dt SHAR 1
10.Os
11.Sh NAME
12.Nm shar
13.Nd create a shell archive of files
14.Sh SYNOPSIS
15.Nm shar Ar
16.Sh DESCRIPTION
17.Nm Shar
18writes an
19.Xr sh 1
20shell script to the standard output which will recreate the file
21hierarchy specified by the command line operands.
22Directories will be recreated and must be specified before the
23files they contain.
24.Pp
25.Nm Shar
26is normally used for distributing small numbers of files by
27.Xr ftp  1
28or
29.Xr mail  1  .
30.Sh SEE ALSO
31.Xr compress 1 ,
32.Xr mail 1 ,
33.Xr uuencode 1 ,
34.Xr tar 1
35.Sh BUGS
36.Nm Shar
37makes no provisions for special types of files or files containing
38magic characters.
39.Pp
40It is easy to insert trojan horses into
41.Nm shar
42files.
43It is strongly recommended that all shell archive files be examined
44before running them through
45.Xr sh  1  .
46Archives produced using this implementation of
47.Nm shar
48may be easily examined with the command:
49.Bd -literal -offset indent
50grep -v '^X' program.shar
51.Ed
52.Sh EXAMPLES
53To create a shell archive of the program
54.Xr ls  1
55and mail it to Rick:
56.Bd -literal -offset indent
57cd ls
58shar `find . -print`  mail -s "ls source" rick
59.Ed
60.Pp
61To recreate the program directory:
62.Bd -literal -offset indent
63mkdir ls
64cd ls
65...
66<delete header lines and examine mailed archive>
67...
68sh archive
69.Ed
70.Sh HISTORY
71The
72.Nm
73command
74.Ud .
75