Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
share|improve this question
2  
Did you make your scripts executable with chmod +x? –  Seth Nov 2 '13 at 21:25
    
What's the output of ls -l? –  Braiam Nov 2 '13 at 21:45
    
chmod +x and wich directory? –  Max Lange Nov 3 '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 –  Max Lange Nov 3 '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). –  user247864 Feb 13 at 15:48

2 Answers 2

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
share|improve this answer
    
because i dont call another script its the script itself. –  Max Lange Nov 3 '13 at 12:33
    
here the content :nopaste.me/paste/444355623527642d42a90f –  Max Lange Nov 3 '13 at 12:34
    
@MaxLange The content of what? There is a C program in the given link which can't be executed just like this from terminal. –  Radu Rădeanu Nov 3 '13 at 21:10
up vote 0 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.