Click here to Skip to main content
11,790,613 members (63,252 online)
Click here to Skip to main content

Start program on double clicking Shell script

, 2 Oct 2012 GPL3 6.7K 78 4
Rate this:
Please Sign up or sign in to vote.
This shows how to start a program by double clicking a shell script in linux environment.


This tip will let you know how to start a program both console and GUI from a bash script.


Before starting mark your bash script or other dependent script as executable.

Self start

The following script will start itself in a console window then ask for root password to start another program named wvdial (Internet Dialer Tool).

if [ "$1" = "Start" ]; then
    sudo wvdial
    konsole -e bash -i "$0" Start  #Konsole or Terminal whichever applicable

Start in console

The following script will start another script in a console window.

konsole -e bash -i "path_to_the_Script"

Starting another  GUI program 

The following script starts a Python GUI code named residing in the same directory.

cd "$(echo $0| sed 's/\/[^\/ ]*.sh/\//g')"


This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


About the Author

Systems Engineer
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.1509028.1 | Last Updated 2 Oct 2012
Article Copyright 2012 by perilbrain
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid