1

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"
2
  • Your last line has a typo. Surely "$GEDIT_CURRENT_CODUMENT_NAME" should be "$GEDIT_CURRENT_DOCUMENT_NAME"?
    – Hugo Buff
    Mar 13, 2014 at 14:17
  • You might also want to look into learning about makefiles.
    – Hugo Buff
    Mar 13, 2014 at 14:19

1 Answer 1

1

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

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .