Bash Scripting

3,619 views

Published on

This slides give you an introduction to Bash Scripting.

0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,619
On SlideShare
0
From Embeds
0
Number of Embeds
30
Actions
Shares
0
Downloads
113
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Bash Scripting

  1. 1. Bash Scripting Vincent Claes http://www.mobile-it.be
  2. 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. 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. 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
  5. 5. Cygwin Screen http://www.mobile-it.be
  6. 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

×