Skip to content

Commit

Permalink
Really small script
Browse files Browse the repository at this point in the history
  • Loading branch information
ylogx committed Jun 23, 2013
1 parent 7e7ff14 commit c5ccc0c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions c.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
##this script compiles .c files
nameLen=${#1}
filename=${1:0:nameLen-2} #striping last 2 char i.e. '.c'
echo " * * * gcc: Compiling $filename * * *"

gcc -g -O2 -Wall -Wextra -Isrc -rdynamic $1 -o $filename.out

echo " * * * Done * * * "
echo "Now Do: ./$filename.out"
12 changes: 12 additions & 0 deletions cpp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
##this script compiles .cpp files
nameLen=${#1}
filename=${1:0:nameLen-4} #striping last 4 char i.e. '.cpp'
echo " * * * g++: Compiling $filename * * *"

g++ -g -O2 -Wall -Wextra -Isrc -rdynamic $1 -o $filename.out

if [-f $filename.test]; then
cat $filename.test | ./$filename.out
fi
echo " * * * Done * * * "
echo "Now Do: ./$filename.out"

0 comments on commit c5ccc0c

Please sign in to comment.