Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

embedding binary files in a shell script?

Status
Not open for further replies.

enigmasoldier

IS-IT--Management
Aug 17, 2005
3
US
I am trying to embed newsyslog in a shell script so that I can run a shell script on each host to install it:

I did 'uuencode /usr/local/sbin/newsyslog newsyslog > script.sh'

Then I added this to the top of script.sh:
#!/bin/sh
tempfile=`mktemp`
cat << EOF >> $tempfile

And I added EOF on a line by itsself at the bottom. The second line of uuencoded data has a part like:

M`A0!"`

and the shell is actually trying to execute the data between the `` so it craps out with errors. Is there a way to embed binary files within a shell script? Or is there some way to escape all of the data of the uuencoded binary file?

Thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top