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 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