1

This is the install file below (sandhi-install.sh). Currently after installing it can only be run from the terminal. I want to make it terminal independent. Making a Ubuntu executable explains how to create an executable but where should I put that code. I think it should be in the install file itself because we want the icon to appear on the desktop after installation completes. I have no prior experience in Shell scripting and bash so sorry if i miss any important information. Please ask if you need any other file. My aim is basically to run sandhi independent of the terminal.

#!/bin/bash

echo "Installing the required dependencies"

sudo apt-get -y install git-core autoconf automake make libtool g++ python-dev swig \
pkg-config libboost1.48-all-dev libfftw3-dev libcppunit-dev libgsl0-dev \
libusb-dev sdcc libsdl1.2-dev python-wxgtk2.8 python-numpy \
python-cheetah python-lxml doxygen python-qt4 python-qwt5-qt4 libxi-dev \
libqt4-opengl-dev libqwt5-qt4-dev libfontconfig1-dev libxrender-dev \
python-serial python-matplotlib

echo "Sciscipy installation starting"
git clone https://github.com/manojgudi/sciscipy-1.0.0.git
cd sciscipy-1.0.0/
sudo ./install

echo "Starting Sandhi installation"
cd ../
git clone http://github.com/manojgudi/sandhi.git
cd sandhi/
git submodule init
git submodule update
git pull origin master
git submodule update

mkdir build
cd build/
cmake ../
make -j 2
sudo make install
sudo ldconfig

echo "Sandhi installation complete. Go to command line and type Sandhi to start Sandhi"
Community
  • 1
  • 1
Karup
  • 2,024
  • 3
  • 22
  • 48

1 Answers1

2

Your script already has all the right ingredients for being a *nix executable - a shebang line and what at least looks like valid code for the interpreter (/bin/bash). All you need to do is to give the relevant user and/or group (or everybody) execute access on the file. For example, if you're the owner of the file:

sandhi@host$ ls -l sandhi.sh
-rw-r--r--  1 purak users 3.5K Oct 11 16:55 sandhi.sh
sandhi@host$ chmod u+x sandhi.sh

Now you can execute it:

sandhi@host$ ls -l sandhi.sh
-rwxr--r--  1 purak users 3.5K Oct 11 16:55 sandhi.sh
sandhi@host$ ./sandhi.sh

For the rest of the question it's unclear what you're asking. The accepted answer to Making a Ubuntu executable says that if the executable foo.bin is in /usr/local/bin (a sensible destination for custom executables) the line in the desktop entry should be Exec=/usr/local/bin/foo.bin.

l0b0
  • 55,365
  • 30
  • 138
  • 223
  • Thanks for your answer.Sorry for being unclear but what I really want is that when any user runs the script above ie on sudo sandhi-install.sh the icon should get install by itself on his/her computer. By following the steps on http://stackoverflow.com/questions/2691214/making-a-ubuntu-executable i get an icon on my computer and it works fine but i want to add that in the script above...so that when you run the above script the icon appears on your computer so that you again dont have to go through all the steps mention here http://stackoverflow.com/questions/2691214/making-a-ubuntu-executable – Karup Oct 19 '14 at 13:13