Hi.
I currently have 5 c source files I've been working on, and every time I'm making a change in one (or more) of them, I have to recompile and run again.
This is very exhausting.
Is there a way to create some kind of batch file with shell commands in it, that can be executed one after the other?
To be more clear about what I'm trying to achieve here:
I have these 5 files:
Code:
backup.c
ex3.c
ex3_input.c
ex3_update.c
test.c
test2.c
sitting in the same folder.
I'm frequently making changes in them, and every time I have to recompile:
Code:
gcc ex3.c
gcc -o input.out ex3_input.c
gcc -o update.out ex3_update.c
gcc -o test.out test.c
gcc -o test2.out test2.c
(not all of them every time, sometime I only make changes in some of them, and therefore compiling some of them)
and run:
What I'm trying to achive is putting all the above commands in one file that can be run with one command.
Can it be done?
Regards,
goghvv
BTW, does anyone know why Ubuntu creates file copies with ~?
for example, every time I'm making some change in the 'backup.c' file, running 'ls -l' shows this:
Code:
-rw-rw-r-- 1 **** backup.c
-rw-rw-r-- 1 **** backup.c~
-rw-rw-r-- 1 **** ex3.c
-rw-rw-r-- 1 **** ex3_input.c
-rw-rw-r-- 1 **** ex3_update.c
-rw-rw-r-- 1 **** test2.c
-rw-rw-r-- 1 **** test.c
What is this backup.c~ file, why is it creating it, and how can this be prevented?
Bookmarks