Sponsored Content
Top Forums Shell Programming and Scripting please can any one help me bundle several files into one Post 302072110 by swissnez on Thursday 27th of April 2006 02:13:51 PM
Old 04-27-2006
Power To be honest the CPU is irrelavant but its a demonstatration script

$ enshar README cars Unix > eg.shar
$ mailx -s 'Re: Please send me your brilliant stuff' \
> p.scott@shu.ac.uk < eg.shar
$

You have to:

o work out how to use the shar file to extract the files it
contains,

o work out how it works, and

o write a shell script called `enshar' to produce shar files to
exactly the same format. (But your's won't have been e-mailed, so
they won't have any e-mail headers!)

Notice that `enshar' doesn't generate files directly; it only sends to
standard output. In the example, `eg.shar' was created because the
user redirected `enshar's output into `eg.shar'.


If `enshar' finds an error, it outputs an error message and executes an
`exit n'. The required error messages and the values of `n' are as
follows:

1 Usage: enshar file [ ... ]

2 enshar: <parameter>: can't be a pathname

3 enshar: <parameter>: is a directory

4 enshar: <parameter>: doesn't exist

5 enshar: <parameter>: can't be read

6 enshar: <parameter>: can't enshar

Notes:

o The first error message is given if the script is called without
parameters.

o The second error message is given if a parameter has a `/' character
in it.

o Error messages three to five are given if the file specified by a
parameter is: a directory, non-existant or unreadable.

o Error message six is given if the file specified by the parameter
contains the line that is used as the `here document' delimiter.

o `enshar' doesn't need to check all its parameters before generating
any output. That is, it can fail after outputting part of the shar
file. It would be an error for `enshar' to output anything else after
generating an error message.

6 In error messages two to six `<parameter>' should be replaced by the
value of the actual parameter that caused the problem.
 

9 More Discussions You Might Find Interesting

1. HP-UX

installation of many patches / bundle

Hi, I need to install these 7 patches on my server: and the below are the 5 dependency to install these patches 1. PHNE_31097; 1(a). PHCO_33205 (dependency) b(a). PHCO_30398 (dependency) 2. PHSS_32508; 3. PHSS_32509; 4. PHSS_32510; 5. PHSS_30970; 6. PHSS_32731; 6(a). PHNE_28810... (2 Replies)
Discussion started by: vipsinghal
2 Replies

2. Solaris

smpatch and recommended bundle

Hello, I am working on patching several systems and have begun working with smpatch as a possibly quicker way to accomplish patching. I have some observations that trouble me. The "smpatch analyze" only shows a small number of patches for a system (yes the registration is complete with a... (0 Replies)
Discussion started by: justme3
0 Replies

3. AIX

Add a bundle to a lpp_source

Hi. I forgot a bundle (X11.dt) in the lpp_source (base OS AIX 7.1). The bundle is now in the CD drive, I need to add it permanently in the lpp_source. What do I have to do ? - copy (where ?) bundle on my NIM server (how to determine what files to copy to have all elements of the bundle ?) ?... (1 Reply)
Discussion started by: stephnane
1 Replies

4. Shell Programming and Scripting

zip files in bundle

Hi, Below is the scneario a.txt b.txt c.txt ....... i have written a script to zip these files & the output after executing script is a.txt.zip b.txt.zip c.txt.zip but i dnt want to zip each individual files it has to done in bundle. EX:A zip folder has to be created ,lets say... (2 Replies)
Discussion started by: jagadeeshn04
2 Replies

5. HP-UX

Install sequence in a bundle

Hi all. I'm wondering if there's a install sequence in a HPUX bundle? I'm trying to put many depots together into 1 single bundle, and use HPUX ignite to install this bundle. But I have to make sure one of the depot is last installed. I feel that if there're many different packages in a bundle,... (0 Replies)
Discussion started by: baibinghere
0 Replies

6. Shell Programming and Scripting

Help for Perl module bundle.

I have a file of lot of perl modules in tar.gz format. They all have dependency on each other for installation. Can anybody guide me for making a bundle so that I can run it in one go and install all the modules. Please note that I can't use CPAN as we don't have Internet connectivity on our... (3 Replies)
Discussion started by: nixhead
3 Replies

7. AIX

Create a bundle of user ids

if I want to create a bundle of user ids on some aix servers, if there is a way not need to do "passwd username" one by one user to set the password? Thanks (3 Replies)
Discussion started by: rainbow_bean
3 Replies

8. Shell Programming and Scripting

Delete duplicates in CA bundle

I do have a big CA bundle certificate file and each time if i get request to add new certificate to the existing bundle i need to make sure it is not present already. How i can validate the duplicates. The alignment of the certificate within the bundle seems to be different. Example: Cert 1... (7 Replies)
Discussion started by: diva_thilak
7 Replies

9. Emergency UNIX and Linux Support

Self signed ca-bundle.crt expired

Hi, I have an issue with openssl. Basically I have a ca certificate which has expired and I have regenerated a new ca.cert from the ca.key file and I have concatenated the output of the new ca.crt file and ca-bundle.crt to a new ca-bundle.crt. Have restarted apache, however I still get the... (1 Reply)
Discussion started by: maverick_here
1 Replies
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
All times are GMT -4. The time now is 10:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy