From 3b9a50cccccbff88b93202e8c1d1fc3ada8228ec Mon Sep 17 00:00:00 2001 From: Greg Date: Sun, 3 Oct 2021 15:04:11 +0000 Subject: [PATCH 1/2] ex01 --- ex01/hello_world.sh | 6 ++++++ ex01/hello_world_test.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 ex01/hello_world.sh diff --git a/ex01/hello_world.sh b/ex01/hello_world.sh new file mode 100644 index 0000000..ad52e87 --- /dev/null +++ b/ex01/hello_world.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +if [ -n "$1" ]; then +echo "Hello, $1!" +else +echo "Hello, World!" +fi diff --git a/ex01/hello_world_test.sh b/ex01/hello_world_test.sh index bc6946b..7355ca2 100644 --- a/ex01/hello_world_test.sh +++ b/ex01/hello_world_test.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bats +#!/usr/local/bin/bats @test "When given no name, it should greet the world!" { run bash hello_world.sh From 8cb767e5f45284cea41a8cc66325afee1d4c0ca1 Mon Sep 17 00:00:00 2001 From: Greg Date: Sun, 3 Oct 2021 15:28:40 +0000 Subject: [PATCH 2/2] ex02 --- ex02/ex02.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 ex02/ex02.sh diff --git a/ex02/ex02.sh b/ex02/ex02.sh new file mode 100644 index 0000000..0e2c15f --- /dev/null +++ b/ex02/ex02.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +input=$( echo $1 | tr "; " "\n" ) + +for i in $input +do +ls -R | grep -Fi $i || echo "the searched PATH is unexisting" +done