From 9e52cac031d7b0f48dfc86a3f98c1874400a4b42 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Fri, 25 Nov 2022 23:17:55 +0100 Subject: [PATCH] updated scripts to create bin dir, dividableBy7 name change --- 7-teiler.c | 29 ----------------------------- compile-all.sh | 1 + compile-and-run.sh | 1 + compile.sh | 1 + 7teiler.c => dividableBy7.c | 0 5 files changed, 3 insertions(+), 29 deletions(-) delete mode 100644 7-teiler.c rename 7teiler.c => dividableBy7.c (100%) diff --git a/7-teiler.c b/7-teiler.c deleted file mode 100644 index f869aac..0000000 --- a/7-teiler.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * lower and upper end as user input - * use a for loop to output all numbers for which 7|x is true. - */ - -#include - -int main() { - - int a,b; - printf("input lower end:\n"); - fflush(stdin); - scanf("%d",&a); - printf("input upper end:\n"); - fflush(stdin); - scanf("%d",&b); - - printf("inputs: %d %d\n", a, b); - for(int i=a; i<=b; i++){ - if(i%7==0) - printf("%d ", i); - if(i==b) - printf("\n"); - } - - // reverse array order - - return 0; -} diff --git a/compile-all.sh b/compile-all.sh index 9392fa4..35b65a2 100755 --- a/compile-all.sh +++ b/compile-all.sh @@ -1,4 +1,5 @@ #!/bin/bash +mkdir -p bin returnCode=0 echo -e "compiling all files in working directory $(pwd)\n" for file in $(/bin/ls *.c); diff --git a/compile-and-run.sh b/compile-and-run.sh index e4ec664..d7bd02a 100755 --- a/compile-and-run.sh +++ b/compile-and-run.sh @@ -1,4 +1,5 @@ #!/bin/bash +mkdir -p bin noext=$(echo "$1" | cut -f 1 -d '.') echo "compiling $1 ..." gcc $1 -o bin/$noext -lm diff --git a/compile.sh b/compile.sh index cfad674..0405b59 100755 --- a/compile.sh +++ b/compile.sh @@ -1,4 +1,5 @@ #!/bin/bash +mkdir -p bin echo "compiling $1 ..." noext=$(echo "$1" | cut -f 1 -d '.') gcc $1 -o bin/$noext -lm diff --git a/7teiler.c b/dividableBy7.c similarity index 100% rename from 7teiler.c rename to dividableBy7.c