How to execute a .sh file downloaded on Trisquel

4 Antworten [Letzter Beitrag]
evrjo
Offline
Beigetreten: 10/01/2016

Hello, folks! I'm a newbie on using command lines. I tried to execute (run) a .sh file of a program I downloaded. It is an Esperanto course. It is called Kurso de Esperanto 4. It is available at http://www.ikurso.net . I've tried to follow the hints available at web.

I'm using Trisquel 8 beta-version for test.

I checked if the Properties of the file kurso4.sh and it was executable as a program.

I then double clicked it and it chose to run it in terminal.

Nothing worked.

Thankfully Yours,
Euleax!

loldier
Offline
Beigetreten: 02/17/2016

Usually, scripts are run 'sh file.sh' or './file.sh (where 'file' should be replaced with the name of the script itself).

SuperTramp83

I am a translator!

Offline
Beigetreten: 10/31/2014

chmod + x --> this will give the file the execution permission.

so, for instance, lets assume your file is in Documents:
in terminal write ->

cd Documents

Now that you are in the right directory (same as the file), you give it:

chmod + x file.sh

and then you run it

./file.sh

TIP: you can drag your file with the mouse to your terminal, which is equivalent of writing its full path:

/home/evrjo/Documents/file.sh

Usually running an application from terminal is excellent for troubleshooting and finding out why it won't start. I assume it is because the file is missing the permission to execute. If not, tell us the error output.

Ignacio.Agullo
Offline
Beigetreten: 09/29/2009

On 11/12/17 20:58, wrote:
> chmod + x --> this will give the file the execution permission.

Right, but without space in between the '+' and the 'x':

chmod +x

--
Ignacio Agulló · name at domain

SuperTramp83

I am a translator!

Offline
Beigetreten: 10/31/2014

Yep, a typo, tx for pointing it out for our new friend!