.\" Copyright (c) 1990 The Regents of the University of California. .\" All rights reserved. .\" .\" %sccs.include.redist.man% .\" .\" @(#)shar.1 5.1 (Berkeley) 05/23/90 .\" .TH SHAR 1 "" .UC 7 .SH NAME shar \- create a shell archive of files .SH SYNOPSIS .nf .ft B shar file ... .ft R .fi .SH DESCRIPTION .I Shar writes an .IR sh (1) shell script to the standard output which will recreate the file hierarchy specified by the command line operands. Directories will be recreated and must be specified before the files they contain. .PP .I Shar is normally used for distributing small numbers of files by .IR ftp (1) or .IR mail (1). .SH SEE ALSO compress(1), mail(1), uuencode(1), tar(1) .SH BUGS .I Shar makes no provisions for special types of files or files containing magic characters. .PP It is easy to insert trojan horses into .I shar files. It is strongly recommended that all shell archive files be examined before running them through .IR sh (1). Archives produced using this implementation of .I shar may be easily examined with the command: .sp .RS grep -v '^X' program.shar .RE .SH EXAMPLES To create a shell archive of the program .IR ls (1) and mail it to Rick: .sp .RS cd ls .br shar `find . -print` | mail -s "ls source" rick .RE .sp To recreate the program directory: .sp .RS mkdir ls .br cd ls .br .br sh archive .RE