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