Blame contrib/shar/shar.1

Packit Service 1d0348
.\" Copyright (c) 1990, 1993
Packit Service 1d0348
.\"	The Regents of the University of California.  All rights reserved.
Packit Service 1d0348
.\"
Packit Service 1d0348
.\" Redistribution and use in source and binary forms, with or without
Packit Service 1d0348
.\" modification, are permitted provided that the following conditions
Packit Service 1d0348
.\" are met:
Packit Service 1d0348
.\" 1. Redistributions of source code must retain the above copyright
Packit Service 1d0348
.\"    notice, this list of conditions and the following disclaimer.
Packit Service 1d0348
.\" 2. Redistributions in binary form must reproduce the above copyright
Packit Service 1d0348
.\"    notice, this list of conditions and the following disclaimer in the
Packit Service 1d0348
.\"    documentation and/or other materials provided with the distribution.
Packit Service 1d0348
.\" 3. All advertising materials mentioning features or use of this software
Packit Service 1d0348
.\"    must display the following acknowledgement:
Packit Service 1d0348
.\"	This product includes software developed by the University of
Packit Service 1d0348
.\"	California, Berkeley and its contributors.
Packit Service 1d0348
.\" 4. Neither the name of the University nor the names of its contributors
Packit Service 1d0348
.\"    may be used to endorse or promote products derived from this software
Packit Service 1d0348
.\"    without specific prior written permission.
Packit Service 1d0348
.\"
Packit Service 1d0348
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
Packit Service 1d0348
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit Service 1d0348
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Packit Service 1d0348
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
Packit Service 1d0348
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit Service 1d0348
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Packit Service 1d0348
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Packit Service 1d0348
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
Packit Service 1d0348
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
Packit Service 1d0348
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
Packit Service 1d0348
.\" SUCH DAMAGE.
Packit Service 1d0348
.\"
Packit Service 1d0348
.\"     @(#)shar.1	8.1 (Berkeley) 6/6/93
Packit Service 1d0348
.\" $FreeBSD$
Packit Service 1d0348
.\"
Packit Service 1d0348
.Dd April 17, 2008
Packit Service 1d0348
.Dt SHAR 1
Packit Service 1d0348
.Os
Packit Service 1d0348
.Sh NAME
Packit Service 1d0348
.Nm shar
Packit Service 1d0348
.Nd create a shell archive of files
Packit Service 1d0348
.Sh SYNOPSIS
Packit Service 1d0348
.Nm
Packit Service 1d0348
.Op Fl br
Packit Service 1d0348
.Op Fl o Ar archive-file
Packit Service 1d0348
.Ar
Packit Service 1d0348
.Sh DESCRIPTION
Packit Service 1d0348
The
Packit Service 1d0348
.Nm
Packit Service 1d0348
command writes a
Packit Service 1d0348
.Xr sh 1
Packit Service 1d0348
shell script which will recreate the file hierarchy specified by the command
Packit Service 1d0348
line operands.
Packit Service 1d0348
.Pp
Packit Service 1d0348
The
Packit Service 1d0348
.Nm
Packit Service 1d0348
command is normally used for distributing files by
Packit Service 1d0348
.Xr ftp 1
Packit Service 1d0348
or
Packit Service 1d0348
.Xr mail 1 .
Packit Service 1d0348
.Pp
Packit Service 1d0348
The following options are available:
Packit Service 1d0348
.Bl -tag -width indent
Packit Service 1d0348
.It Fl b
Packit Service 1d0348
Use an alternative binary format.  Content of files will be uuencoded.
Packit Service 1d0348
This option should be used to archive binary files correctly.
Packit Service 1d0348
In this mode also file permissions will be stored to the archive.
Packit Service 1d0348
uudecode(1) is needed to extract archives created with this option.
Packit Service 1d0348
.It Fl o Ar archive-file
Packit Service 1d0348
Redirect output to
Packit Service 1d0348
.Ar archive-file .
Packit Service 1d0348
.It Fl r
Packit Service 1d0348
If
Packit Service 1d0348
.Ar file
Packit Service 1d0348
given on command line is a directory the entire subtree will be archived.
Packit Service 1d0348
Symbolic links given on command line are followed.  Other symbolic links will
Packit Service 1d0348
be archived as such.
Packit Service 1d0348
.El
Packit Service 1d0348
.Sh EXAMPLES
Packit Service 1d0348
To create a shell archive of the program
Packit Service 1d0348
.Xr ls 1
Packit Service 1d0348
and mail it to Rick:
Packit Service 1d0348
.Bd -literal -offset indent
Packit Service 1d0348
cd ls
Packit Service 1d0348
shar -r . \&| mail -s "ls source" rick
Packit Service 1d0348
.Ed
Packit Service 1d0348
.Pp
Packit Service 1d0348
To recreate the program directory:
Packit Service 1d0348
.Bd -literal -offset indent
Packit Service 1d0348
mkdir ls
Packit Service 1d0348
cd ls
Packit Service 1d0348
\&...
Packit Service 1d0348
<delete header lines and examine mailed archive>
Packit Service 1d0348
\&...
Packit Service 1d0348
sh archive
Packit Service 1d0348
.Ed
Packit Service 1d0348
.Sh SEE ALSO
Packit Service 1d0348
.Xr compress 1 ,
Packit Service 1d0348
.Xr mail 1 ,
Packit Service 1d0348
.Xr tar 1 ,
Packit Service 1d0348
.Xr uuencode 1 ,
Packit Service 1d0348
.Xr uuencode 5
Packit Service 1d0348
.Sh HISTORY
Packit Service 1d0348
The
Packit Service 1d0348
.Nm
Packit Service 1d0348
command appeared in
Packit Service 1d0348
.Bx 4.4 .
Packit Service 1d0348
This is a re-implementation based on the libarchive(3) library.
Packit Service 1d0348
.Sh BUGS
Packit Service 1d0348
The
Packit Service 1d0348
.Nm
Packit Service 1d0348
command makes no provisions for hard links.
Packit Service 1d0348
.Pp
Packit Service 1d0348
Files containing magic characters or files without a newline ('\\n') as the
Packit Service 1d0348
last character are not handled correctly with the default format.  Use the -b
Packit Service 1d0348
option for binary files.
Packit Service 1d0348
.Pp
Packit Service 1d0348
It is easy to insert trojan horses into
Packit Service 1d0348
.Nm
Packit Service 1d0348
files.
Packit Service 1d0348
It is strongly recommended that all shell archive files be examined
Packit Service 1d0348
before running them through
Packit Service 1d0348
.Xr sh 1 .
Packit Service 1d0348
Archives produced using this implementation of
Packit Service 1d0348
.Nm
Packit Service 1d0348
may be easily examined with the command:
Packit Service 1d0348
.Bd -literal -offset indent
Packit Service 1d0348
egrep -v '^[X#]' shar.file
Packit Service 1d0348
.Ed