LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Can double-click the shell script and choose "Run in Terminal" in Redhat? (https://www.linuxquestions.org/questions/programming-9/can-double-click-the-shell-script-and-choose-run-in-terminal-in-redhat-447300/)

edwardsiow 05-22-2006 04:45 AM

Can double-click the shell script and choose "Run in Terminal" in Redhat?
 
Hi,

i fail to run a shell script by double-clicking on it and select "Run in Terminal".

but i success to run the shell script if i open the terminal, go to the location where it put and run the script manually.

can i know why? how to make my shell script can run well by double-clicking on it.

thanks a lot..

nhydra 05-22-2006 05:08 AM

I am not sure but may be the reason for that is KDE/GNOME files associations. I have installed Slack and it execute all my shell scripts when i click on it. Some other distributions don't do that.
And another thing, the shell script should have .sh extension. It is for that to be recognized.

edwardsiow 05-22-2006 08:56 PM

Quote:

Originally Posted by nhydra
I am not sure but may be the reason for that is KDE/GNOME files associations. I have installed Slack and it execute all my shell scripts when i click on it. Some other distributions don't do that.
And another thing, the shell script should have .sh extension. It is for that to be recognized.

Thanks for your reply..

i have changed the shell script extension to .sh but still can't work.

Here is my shell script. The function of this shell script is to copy all the files in the CD-ROM into desktop.

Quote:

#!/bin/bash
#File copy with progress indicators

mkdir ~/.gnome-desktop/MathsF5MyCD

echo "Preparing to copy"
cp -v -r ./Data ~/.gnome-desktop/MathsF5MyCD
cp -v -r ./Fonts ~/.gnome-desktop/MathsF5MyCD
cp -v -r ./Plugin ~/.gnome-desktop/MathsF5MyCD
cp -v -r ./Xtras ~/.gnome-desktop/MathsF5MyCD
cp -v ./mathsf5.exe ~/.gnome-desktop/MathsF5MyCD
cp -v ./Linux_Run ~/.gnome-desktop/MathsF5MyCD
cp -v ./Linux_Setup ~/.gnome-desktop/MathsF5MyCD
cp -v ./Linux_Wine.rpm ~/.gnome-desktop/MathsF5MyCD
cp -v ./Linux_install_help.txt ~/.gnome-desktop/MathsF5MyCD
cp -v ./fontmap.txt ~/.gnome-desktop/MathsF5MyCD

echo "finish copy"
when i run in terminal manually, it works. but when i double click the shell script, it fails to run.

please help me..thanks


All times are GMT -5. The time now is 04:36 PM.