3

I have recently Downloaded yEd Graph Editor Installer shell script, which size is 57M

When inspect that script

head script

root@home-pc:/usr/local/src# head yEd-3.11.1_32-bit_setup.sh
#!/bin/sh

# Uncomment the following line to override the JVM search sequence
# INSTALL4J_JAVA_HOME_OVERRIDE=
# Uncomment the following line to add additional VM parameters
# INSTALL4J_ADD_VM_PARAMS=


INSTALL4J_JAVA_PREFIX=""
GREP_OPTIONS=""

Tail Script

root@home-pc:/usr/local/src# tail yEd-3.11.1_32-bit_setup.sh 
��D�r�B��|�QO���W~��
_l�Tނ�t:M�Z�*��Ѵ��'�����(�\�A^��[��e�|����K+�<ѡ)��k
                                                    �l������3$+
                                                                `�cF���b\]��14�'qA�)�F�Pg��l���)�x{��A�Qك�Mf`^9e���C5�-���K&K��n�]��v�7�����]�wS�)~��?`�ߴ=����ں.AE�u����v�]�������
>1�f�\8w�+�mw�������6M��2��½���8g�M���Ǵ�^ͪ�A^�fKm*�6Yb
                                                        u�8B~!  ��Ue����'����
                                                                                     �
�B����`1���8�!$-!�k�2O�u����Į��%�<8@�������)���-�5a��^h����[�v�x j��/~�3��
                                                                                  �u�b�l��.jx3W��n����>���.���
    �
���d�Ox�*~*~*~*~*~�*��*��*����������������������������������������������������{ے

So could please you help me with following question :

  • Why this shell script have binary like content ?
  • What is use of this content ?
  • if it useful then how can I implement the same ?
Rahul Patil
  • 24,281
  • 25
  • 80
  • 96

1 Answers1

6

It's most likely a self contained executable. The executables, directory structure, etc. are all included as a binary blob within this single file. There are several tools that can assist in the creation of self contained executables such as this one.

Here's an example of one such application that can do this, makeself - Make self-extractable archives on Unix.

There are others floating around the internet. Search for "self contained executable linux" and you'll find them. Also take a look at this other U&L Q&A titled: How to make Linux application (all in one fille) installer? for other methods.

slm
  • 363,520
  • 117
  • 767
  • 871
  • 1
    `shar` is the classic self-extracting format of this type. `shar` stands for SHell ARchive. One only needs a shell to run the resulting self-extracting archive (typically a bourne shell) – kurtm Oct 15 '13 at 21:07
  • @kurtm - that one is referenced in the link I included: http://unix.stackexchange.com/questions/70828/how-to-make-linux-application-all-in-one-fille-installer/70840#70840 – slm Oct 15 '13 at 21:08