PDA

View Full Version : [gnome] CLI running .sh file



squee
May 1st, 2009, 10:46 PM
Ok trying to run JSMS.sh

It exists in /home/USER/JSMS/JSMS.sh

I want to create a launcher for it on the desktop, but I cant get it to work. What command should I be using there?


If that isn't possible, I've been trying to run the program from the command line but it is strange. If I type: cd JSMS then sh JSMS.sh it works, but if I type cd JSMS | sh JSMS.sh it doesnt work.

Any ideas? thanks guys.

taurus
May 1st, 2009, 10:49 PM
Does it run if you run this?


sh ~/JSMS/JSMS.sh
Otherwise, make sure JSMS.sh has an executable permissions.


cd ~/JSMS
chmod 755 JSMS.sh
cd
~/JSMS/JSMS.sh

squee
May 1st, 2009, 11:10 PM
I've made it executable but still wont run with those commands.

Edit: It does work now if I do sh ~/JSMS/JSMS.sh in the terminal, but not as a launcher.

taurus
May 1st, 2009, 11:12 PM
Which command, ~/JSMS/JSMS.sh?

taurus
May 1st, 2009, 11:18 PM
How did you create a launcher for it?

Bios Element
May 1st, 2009, 11:20 PM
Do you have this at the top of the file?

#!/bin/bash

squee
May 1st, 2009, 11:26 PM
"
#!/bin/sh
"
is at the top of the file. Should I replace it?


created launcher by rightclicking on desktop...

taurus
May 1st, 2009, 11:35 PM
What did you put in for the Command: field?

squee
May 1st, 2009, 11:37 PM
Command field: sh ~/JSMS/JSMS.sh

taurus
May 1st, 2009, 11:44 PM
Remove the sh in front, just ~/JSMS/JSMS.sh.

Wobblybob
May 1st, 2009, 11:44 PM
Command field: sh ~/JSMS/JSMS.sh

try just ~/JSMS/JSMS.sh in the Command field

squee
May 1st, 2009, 11:58 PM
try just ~/JSMS/JSMS.sh in the Command field

Cant believe this. Doesnt work: "Details: Failed to execute child process "~/JSMS/JSMS.sh" (No such file or directory)"

but it clearly exists. I'm looking at it! :lolflag:

Path is definately Home/USER/JSMS/JSMS.sh

brunogirin
May 2nd, 2009, 12:02 AM
Try to give it the fully qualified path instead: /home/USER/JSMS/JSMS.sh

taurus
May 2nd, 2009, 12:03 AM
Try the absolute path then.


/home/USER/JSMS/JSMS.sh
Also, probably a good idea to change


#!/bin/sh
to

#!/bin/bash

DGortze380
May 2nd, 2009, 12:04 AM
If I type: cd JSMS then sh JSMS.sh it works, but if I type cd JSMS | sh JSMS.sh it doesnt work.

Any ideas? thanks guys.

because you don't want a pipe, you want a logical and.

cd JSMS && ./JSMS.sh

squee
May 2nd, 2009, 12:09 AM
Try the absolute path then.


/home/USER/JSMS/JSMS.sh
Also, probably a good idea to change


#!/bin/sh
to

#!/bin/bash


Done. Still not working. I've had enough for tonight need sleep. Thanks for all the help guys. Atleast I know what I should be doing now.