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.

Is there any way to compile and run .c files by using a shortcut key using gedit? I know its possible for java and C++, and I read somewhere that it is possible to do so using scripts in external tools. I'm currently compiling my files by gcc -Wall name name.c then ./name, but i would like to make this process faster

I already tried the below script for my shortcut but it generates an error saying

fatal error: no input files

#!/bin/sh
echo "$GEDIT_CURRENT_DOCUMENT_NAME"
gcc  "$GEDIT_CURRENT_CODUMENT_NAME"
share|improve this question
    
Your last line has a typo. Surely "$GEDIT_CURRENT_CODUMENT_NAME" should be "$GEDIT_CURRENT_DOCUMENT_NAME"? –  Hugo Buff Mar 13 at 14:17
    
You might also want to look into learning about makefiles. –  Hugo Buff Mar 13 at 14:19

1 Answer 1

The default build command of the gedit external tools works perfectly for me (run using Ctrl+F8):

enter image description here

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.