| 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.2 (Berkeley) %G% |
| 7 | .\" |
| 8 | .TH SHAR 1 "%Q" |
| 9 | .UC 7 |
| 10 | .SH NAME |
| 11 | shar \- create a shell archive of files |
| 12 | .SH SYNOPSIS |
| 13 | .nf |
| 14 | .ft B |
| 15 | shar file ... |
| 16 | .ft R |
| 17 | .fi |
| 18 | .SH DESCRIPTION |
| 19 | .I Shar |
| 20 | writes an |
| 21 | .IR sh (1) |
| 22 | shell script to the standard output which will recreate the file |
| 23 | hierarchy specified by the command line operands. |
| 24 | Directories will be recreated and must be specified before the |
| 25 | files they contain. |
| 26 | .PP |
| 27 | .I Shar |
| 28 | is normally used for distributing small numbers of files by |
| 29 | .IR ftp (1) |
| 30 | or |
| 31 | .IR mail (1). |
| 32 | .SH SEE ALSO |
| 33 | compress(1), mail(1), uuencode(1), tar(1) |
| 34 | .SH BUGS |
| 35 | .I Shar |
| 36 | makes no provisions for special types of files or files containing |
| 37 | magic characters. |
| 38 | .PP |
| 39 | It is easy to insert trojan horses into |
| 40 | .I shar |
| 41 | files. |
| 42 | It is strongly recommended that all shell archive files be examined |
| 43 | before running them through |
| 44 | .IR sh (1). |
| 45 | Archives produced using this implementation of |
| 46 | .I shar |
| 47 | may be easily examined with the command: |
| 48 | .sp |
| 49 | .RS |
| 50 | grep -v '^X' program.shar |
| 51 | .RE |
| 52 | .SH EXAMPLES |
| 53 | To create a shell archive of the program |
| 54 | .IR ls (1) |
| 55 | and mail it to Rick: |
| 56 | .sp |
| 57 | .RS |
| 58 | cd ls |
| 59 | .br |
| 60 | shar `find . -print` | mail -s "ls source" rick |
| 61 | .RE |
| 62 | .sp |
| 63 | To recreate the program directory: |
| 64 | .sp |
| 65 | .RS |
| 66 | mkdir ls |
| 67 | .br |
| 68 | cd ls |
| 69 | .br |
| 70 | <delete header lines and examine mailed archive> |
| 71 | .br |
| 72 | sh archive |
| 73 | .RE |