Operating System - HP-UX
1828634 Members
2028 Online
109983 Solutions
New Discussion

How to pack a set of scripts

 
SOLVED
Go to solution
Michele (Mike) Alberton
Regular Advisor

How to pack a set of scripts

Hi !

Usually when we deliver software to our customers I put everything into a tar file, and then I add a setup.sh script to take care of initial configuration and of untarring the bundle plus some additional file movement.

This means that I have to provide two files, the .tar archive and the setup.sh script.
Is there any way to pack everything into a single file which includes both the tar and the setup.sh ?

I know this is much Windows like, but it would be something nice to have and easy to maintain.

Thanks a lot !

Mike
3 REPLIES 3
Mark Grant
Honored Contributor
Solution

Re: How to pack a set of scripts

Have a look at the "shar" command. It does exactly what you want.
Never preceed any demonstration with anything more predictive than "watch this"
Geoff Wild
Honored Contributor

Re: How to pack a set of scripts

You want to create a "shell" archive.

The your users just have to sh yourfile.sh

Man shar

shar - make a shell archive package

SYNOPSIS
shar [options] [file|dir] ... > package

DESCRIPTION
The shar command bundles the named files and directories into a single
distribution package suitable for mailing or moving. The files can
contain any data, including executables. The resulting package,
written to standard output, is a shell script file that can be edited
(to add messages at the beginning, etc.).


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Michele (Mike) Alberton
Regular Advisor

Re: How to pack a set of scripts

Thanks Folks !

So fast, so perfect, I really appreciated !

Mike