From 442a49ad5a48d417345959b903ae6a6d32d55759 Mon Sep 17 00:00:00 2001 From: Haidong Ji Date: Fri, 15 Apr 2022 15:51:30 -0500 Subject: Great C programming fun Excellent fundamentals and displine training, many tools and techniques exercises: gdb, emacs, valgrind, git --- 02_code1/test.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 02_code1/test.sh (limited to '02_code1/test.sh') diff --git a/02_code1/test.sh b/02_code1/test.sh new file mode 100755 index 0000000..eb21e2b --- /dev/null +++ b/02_code1/test.sh @@ -0,0 +1,34 @@ +#!/bin/bash +cat > temp.c < +#include +EOF +cat code1.c >> temp.c +gcc -Wall -Werror -pedantic -std=gnu99 temp.c -o code1 2>errors.txt +if [ "$?" = "0" ] + then + echo "Your code appears to have legal syntax!" + echo "Here is what I get when I run it..." + echo "-----------------" + ./code1 + echo "-----------------" + echo "Here is what I would expect the answers to be:" + echo "----------------" + cat <