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.6 (Berkeley) 03/23/93 7.\" 8.Dd 9.Dt SHAR 1 10.Os BSD 4.4 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 (the 24.Xr find 1 25utility does this correctly). 26.Pp 27.Nm Shar 28is normally used for distributing files by 29.Xr ftp 1 30or 31.Xr mail 1 . 32.Sh SEE ALSO 33.Xr compress 1 , 34.Xr mail 1 , 35.Xr uuencode 1 , 36.Xr tar 1 37.Sh BUGS 38.Nm Shar 39makes no provisions for special types of files or files containing 40magic characters. 41.Pp 42It is easy to insert trojan horses into 43.Nm shar 44files. 45It is strongly recommended that all shell archive files be examined 46before running them through 47.Xr sh 1 . 48Archives produced using this implementation of 49.Nm shar 50may be easily examined with the command: 51.Bd -literal -offset indent 52egrep -v '^[X#]' shar.file 53.Ed 54.Sh EXAMPLES 55To create a shell archive of the program 56.Xr ls 1 57and mail it to Rick: 58.Bd -literal -offset indent 59cd ls 60shar `find . -print` \&| mail -s "ls source" rick 61.Ed 62.Pp 63To recreate the program directory: 64.Bd -literal -offset indent 65mkdir ls 66cd ls 67... 68<delete header lines and examine mailed archive> 69... 70sh archive 71.Ed 72.Sh HISTORY 73The 74.Nm 75command appears in 76.Bx 4.4 . 77