LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (http://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Shell command to start program? (http://www.linuxquestions.org/questions/linux-desktop-74/shell-command-to-start-program-488724/)

neilcpp 10-02-2006 09:38 AM

Shell command to start program?
 
I have a program that normally can only be started from the terminal. Now, my terminal uses the bourne shell. I want to create a icon on the desktop to start the program. It will not start by simply giving the path name, because the shell needs to be invoked first - i think!

I need to now what shell command I need to insert in the icon command path, so the program will fire up under a terminal window, when i click the icon.
thnaks:confused:

KenJackson 10-02-2006 10:07 AM

You can create a little shell script like this:
Code:

#!/bin/bash
command to be run

Put it someplace, like ~/bin/commandscript, make it executable with
Code:

chmod +x ~/bin/commandscript
and then use $HOME/bin/commandscript with you icon.

forbajato 10-07-2006 03:53 AM

If you need your terminal to stay open with the program running in it you may want to check your terminal's command options when writing the script. For instance I use xterm as my terminal so if I want to execute program foo with arguments -i bar -e BAR in a new terminal I may issue the command:

xterm -e foo -i bar -e BAR

The -e after xterm passes what comes after it as a command to be run in the terminal. If you wrap this type command into your script then call the script from an icon that should work.


All times are GMT -5. The time now is 08:55 AM.