1

I wanted to run a small test program, but if I execute it the terminal says:

./geany_run_script.sh: 5: ./geany_run_script.sh: ./main: Permission denied


------------------
(program exited with code: 126)
Press return to continue
Seth
  • 58,122
Pixdigit
  • 155
  • 1
  • 4
  • 17
  • 2
    Did you make your scripts executable with chmod +x? – Seth Nov 02 '13 at 21:25
  • What's the output of ls -l? – Braiam Nov 02 '13 at 21:45
  • chmod +x and wich directory? – Pixdigit Nov 03 '13 at 12:03
  • drwxr-xr-x 2 max max 4096 Nov 1 14:30 Arbeitsfläche drwxr-xr-x 2 max max 4096 Nov 1 14:30 Bilder drwxr-xr-x 2 max max 4096 Nov 1 14:30 Dokumente drwxr-xr-x 2 max max 4096 Nov 2 21:45 Downloads -rw-r--r-- 1 max max 8445 Okt 30 22:17 examples.desktop drwxr-xr-x 2 max max 4096 Nov 1 14:30 Musik drwxr-xr-x 2 max max 4096 Nov 1 14:30 Öffentlich drwxr-xr-x 2 max max 4096 Nov 1 14:30 Videos drwxr-xr-x 2 max max 4096 Nov 1 14:30 Vorlagen – Pixdigit Nov 03 '13 at 12:04
  • I had the same problem as yours. Note that if you save your program with .c extension and after that, compile, construct and execute, it works fine (for me). –  Feb 13 '14 at 15:48
  • See how to make file executable from within Geany here. – jarno Nov 24 '20 at 16:53

3 Answers3

1

You call in your script another file/script - ./main. Be sure that you have permission to execute that file (in fact this is saying that exit code: 126). To do this, run the following command:

chmod +x /path/to/main
Radu Rădeanu
  • 169,590
1

The program was stored in a fat system and files's executable bit can't be changed there.

guntbert
  • 13,134
Pixdigit
  • 155
  • 1
  • 4
  • 17
-1

All I need to to solve Geany permission denied error is to specify the extension of the file that I need to execute in my case I want to execute python programming file e.g. *.py then I save it .py and execute the file by press F5 the permission denied gone.

  • Well my file was with .sh filename extension and it did not change permission automatically, but see my comment on the question. – jarno Nov 24 '20 at 16:56