2. mkdir DevProject
cd DevProject
nano testprogram.c
put in this file the code for c program (for example see next slide)
control + o
press enter to save file to testprogram.c
control + x to exit nano
nano bashscript.sh
put in this file code for bash script
control +o
press enter to save file to bashscript.sh
control + x to exit nano
chmod 744 bashscript.sh
./bashscript.sh testprogram
* (if you want to use this script for other c-files you can do it by using
./bashscript.sh <putherefilenameofprogram without .c> )
http://www.mobile-it.be
3. C Program
// created by Vincent Claes
//http://www.mobile-it.be
#include <stdio.h>
main()
{
printf(“Hello Worldn”);
}
http://www.mobile-it.be
4. Bash Program
#!/bin/sh
#Created by Vincent claes
echo quot;Script to automatically compile and run C program“
gcc $1quot;.cquot; -o $1
./$1
http://www.mobile-it.be
6. Bash Script for viewing assembler
code
#!/bin/sh
#Created by Vincent Claes
#http://www.mobile-it.be
echo quot;Script for viewing assembler file created from C program“
gcc $1quot;.cquot; –S
cat $1quot;.Squot;
http://www.mobile-it.be