From 3969d79c84bc328d74074cb4e48d6376f1a996f2 Mon Sep 17 00:00:00 2001 From: miguel Date: Fri, 25 Mar 2022 14:08:32 +0000 Subject: [PATCH] issues on public --- sh/tests/to-git-or-not-to-git_test.sh | 16 ++++++++++++---- subjects/cat/README.md | 3 ++- subjects/cl-camp6/README.md | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/sh/tests/to-git-or-not-to-git_test.sh b/sh/tests/to-git-or-not-to-git_test.sh index b319d6ed..7f546b1b 100755 --- a/sh/tests/to-git-or-not-to-git_test.sh +++ b/sh/tests/to-git-or-not-to-git_test.sh @@ -4,8 +4,16 @@ set -euo pipefail IFS=' ' +FILENAME="student/to-git-or-not-to-git.sh" -submitted=$(bash student/to-git-or-not-to-git.sh) -expected=$(bash solutions/to-git-or-not-to-git.sh) - -diff <(echo "$submitted") <(echo "$expected") +if [ -f ${FILENAME} ]; then + if [ -s ${FILENAME} ]; then + submitted=$(bash student/to-git-or-not-to-git.sh) + expected=$(bash solutions/to-git-or-not-to-git.sh) + diff <(echo "$submitted") <(echo "$expected") + else + echo "File exist but empty" + fi +else + echo "File does not exist" +fi diff --git a/subjects/cat/README.md b/subjects/cat/README.md index cb59935e..841bfd25 100644 --- a/subjects/cat/README.md +++ b/subjects/cat/README.md @@ -14,7 +14,8 @@ $ cat < quest8T.txt "Alan Mathison Turing was an English mathematician, computer scientist, logician, cryptanalyst. Turing was highly influential in the development of theoretical computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine, which can be considered a model of a general-purpose computer. Turing is widely considered to be the father of theoretical computer science and artificial intelligence." EOF $ go run . abc -ERROR: abc: No such file or directory +ERROR: open abc: no such file or directory +exit status 1 $ go run . quest8.txt "Programming is a skill best acquired by pratice and example rather than from books" by Alan Turing $ go run . quest8.txt abc diff --git a/subjects/cl-camp6/README.md b/subjects/cl-camp6/README.md index 6d44293b..4e988502 100644 --- a/subjects/cl-camp6/README.md +++ b/subjects/cl-camp6/README.md @@ -4,7 +4,7 @@ "Now, do your inventory" -Create a file `countfiles.sh`, which will print the number **(and only the number)** of regular files and folders contained in the current directory and its sub-folders : +Create a file `countfiles.sh`, which will print the number **(and only the number)** of regular files and folders contained in the current directory and its sub-folders (the current directory must be included in the count): ### Usage