Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

shar(1) [osx 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

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
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

READING mail from /var/mail/user

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)
Discussion started by: petoSVK
21 Replies

2. Shell Programming and Scripting

Read from file then purge or archive.

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)
Discussion started by: kayarsenal
15 Replies

3. Shell Programming and Scripting

find largest file

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)
Discussion started by: mohan705
15 Replies

4. Shell Programming and Scripting

Count the number of files in a directory

Hi All, How do i find out the number of files in a directory using unix command ? (14 Replies)
Discussion started by: Raynon
14 Replies

5. Shell Programming and Scripting

Edited: compare two files and print mismatch

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)
Discussion started by: kingpeejay
16 Replies

6. Shell Programming and Scripting

editing files

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)
Discussion started by: cobroraj
17 Replies

7. Shell Programming and Scripting

Find files modified in last hour sunOS 5.10

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)
Discussion started by: rich@ardz
19 Replies

8. Shell Programming and Scripting

Bash script find longest line/lines in several files

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)
Discussion started by: 1tempus1
23 Replies

9. Shell Programming and Scripting

Sending email with multiple files..

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)
Discussion started by: msrahman
30 Replies

10. Shell Programming and Scripting

Missing conjunction

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)
Discussion started by: svajhala
17 Replies

11. Shell Programming and Scripting

Need Help with a Data Extract script

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)
Discussion started by: kmr023
14 Replies

12. UNIX for Dummies Questions & Answers

[Solved] Filesystem getting full. Need a monitoring script

Hi, I am new to shell scripting in unix HP-UX. I need to determine how much a perticular file system is full and if it goes over 80% it should notify through mail about which are the files which are greater than 1 GB size. I used df -k command it is showing the alloocated KB and the %used... (14 Replies)
Discussion started by: Soma Das
14 Replies

13. Shell Programming and Scripting

Finding files which contains anyone from the given patterns

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)
Discussion started by: Rishi26
14 Replies

14. Shell Programming and Scripting

Wildcards and exceptions

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)
Discussion started by: Danny.Boy
19 Replies

15. Shell Programming and Scripting

Printing line in shell script

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)
Discussion started by: ajayram_arya
14 Replies