SHAR(1) BSD General Commands Manual SHAR(1)NAME
shar -- create a shell archive of files
SYNOPSIS
shar file ...
DESCRIPTION
The shar command writes a sh(1) shell script to the standard output which will recreate the file hierarchy specified by the command line op-
erands. Directories will be recreated and must be specified before the files they contain (the find(1) utility does this correctly).
The shar command is normally used for distributing files by ftp(1) or mail(1).
EXAMPLES
To create a shell archive of the program ls(1) and mail it to Rick:
cd ls
shar `find . -print` | mail -s "ls source" rick
To recreate the program directory:
mkdir ls
cd ls
...
<delete header lines and examine mailed archive>
...
sh archive
SEE ALSO compress(1), mail(1), tar(1), uuencode(1)HISTORY
The shar command appeared in 4.4BSD.
BUGS
The shar command makes no provisions for special types of files or files containing magic characters. The shar command cannot handle files
without a newline ('
') as the last character.
It is easy to insert trojan horses into shar files. It is strongly recommended that all shell archive files be examined before running them
through sh(1). Archives produced using this implementation of shar may be easily examined with the command:
egrep -v '^[X#]' shar.file
BSD June 6, 1993 BSD
Check Out this Related Man Page
SHAR(1) BSD General Commands Manual SHAR(1)NAME
shar -- create a shell archive of files
SYNOPSIS
shar file ...
DESCRIPTION
shar writes an 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 (the find(1) utility does this correctly).
shar is normally used for distributing files by ftp(1) or mail(1).
SEE ALSO compress(1), mail(1), tar(1), uuencode(1)BUGS
shar makes no provisions for special types of files or files containing magic characters.
EXAMPLES
To create a shell archive of the program ls(1) and mail it to Rick:
cd ls
shar `find . -print` | mail -s "ls source" rick
To recreate the program directory:
mkdir ls
cd ls
...
<delete header lines and examine mailed archive>
...
sh archive
HISTORY
The shar command appears in 4.4BSD.
SECURITY CONSIDERATIONS
It is easy to insert trojan horses into shar files. It is strongly recommended that all shell archive files be examined before running them
through sh(1). Archives produced using this implementation of shar may be easily examined with the command:
egrep -v '^[X#]' shar.file
4.4BSD June 6, 1993 4.4BSD
Hi,
I would need to find for files modified more than one day only in the current directory specified and NOT its subdirectories included.
How do I do this? (18 Replies)
Hello guys,
I'm in desperate need. I need to write a script that behaves like a "mail" shell program.
I've a base of the program -menu and so on, but what I cannot do is how to read messages from /var/mail/user. I would like to separate them as "mail" program does, but I;m just a newbie and... (21 Replies)
Hi All,
I have a root directory /tmp and I want to purge files or archive files in its subsequent subfolders.I listed the path of files I want to purge(archive) and the #of days.
(purge)
DAYS PATH
7 /tmp/arsenal/*
5 /tmp/chelsea/*
(archive?
the same as above but different folders... (15 Replies)
Hi,
1)I have XX directory and have lot of files ,I want to find largest file in that
directory
2)how calculate the size of file in MB.
Thanks,
Mohan (15 Replies)
Using unix shell script, how to compare two files and print lines with mismatch? Below are the requirements:
1. The number of lines on the two files is not the same.
2. The difference/mismatch can be found on the second or third column.
3. The comparison is not between line 1 of file 1 and line... (16 Replies)
Is there any command which I can apply from the command line to find and replace a particular text say "00:00:00:00" with "00" from all the files( where ever this text exists) of the current directory? (17 Replies)
trying to find a way to locate files modified in the last hour in a shell script, unfortunately the command 'find . -mmin -60' is not supported on SunOS 5.10 (works on OpenSolaris 5.11 :mad:)
Does anyone know a method of doing this in shell script on 5.10?
cheers (19 Replies)
Hello everyone...
I need to find out, how to find longest line or possibly lines in several files which are arguments for script. The thing is, that I tried some possibilities before, but nothing worked correctly.
Example
when i use:
awk ' { if ( length > L ) { L=length ;s=$0 } }END{ print... (23 Replies)
Hello,,
I am loading data into the 4 tables from 4 different input files.
The data gets loaded, and the e-mail is also sent to the user, but the log files for all the 4 files is not been sent..
I am trying to send e-mail to users with the log file as attachment.
The script is as follows:... (30 Replies)
Hi Gurus,
I have prepared a script to find the log file based on a date range defined in one of the environment files, archive the logs files and move them to a particular directory.
Below is the script:
. /home/.profile
. /home/.inf_env
logfile=$scripts_path/Logs/file_archive1.log... (17 Replies)
hi,
i'am trying to write a shell program which takes a data element
from one file(var/tmp/usr1/pools)and search that data element
in a zipped file in archive location/usr01/archive/PSta*.Z).
cat var/tmp/usr1/pools
FC5173
FI5178
BE5221
FE5229
ST1604
ls /usr01/archive/PSta*.Z... (14 Replies)
Hi All,
I need help as i am not able to create shell script for a scenario.
i have 3000 numbers and want to search all the files which contain anyone of the above pattern.
the files are in folder structure.
Thanks and Regards
Rishi Dhawan (14 Replies)
Hello:
I have a very basic question. I'd like to select all files except for one file. For example, say I want to move all of the files in my current directory to a subdirectory called archive, I would use mv ./* archive/ But what if I want to move all files except for README.txt? Is there an... (19 Replies)
Need assistance in getting a shell program .
I have csv file and each line has comma separated number. I wanted to take of the comas and print each number in each line . below example. Appreicate your help
Row with number
... (14 Replies)