From 497b331f9d3031df0c9300d4919d60b4bc9c78f9 Mon Sep 17 00:00:00 2001 From: miguel Date: Thu, 22 Dec 2022 15:46:57 +0000 Subject: [PATCH] docs(set-env-vars): add hints, fixx the test to block echo and fix solution --- sh/tests/set-env-vars_test.sh | 1 + sh/tests/solutions/set-env-vars.sh | 1 + subjects/devops/set-env-vars/README.md | 4 ---- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sh/tests/set-env-vars_test.sh b/sh/tests/set-env-vars_test.sh index e84ad193..35d51e2c 100755 --- a/sh/tests/set-env-vars_test.sh +++ b/sh/tests/set-env-vars_test.sh @@ -7,6 +7,7 @@ IFS=' FILENAME="student/set-env-vars.sh" +# echo not allowed if [ -s ${FILENAME} ]; then if [[ $(cat $FILENAME | grep echo | wc -l) -ne 0 ]]; then echo "echo is not allowed in this exercise!" diff --git a/sh/tests/solutions/set-env-vars.sh b/sh/tests/solutions/set-env-vars.sh index 12768eec..eab92dfc 100755 --- a/sh/tests/solutions/set-env-vars.sh +++ b/sh/tests/solutions/set-env-vars.sh @@ -3,4 +3,5 @@ export MY_MESSAGE="Hello World" export MY_NUM=100 export MY_PI=3.142 +# Grep only new vars printenv | grep "MY_" diff --git a/subjects/devops/set-env-vars/README.md b/subjects/devops/set-env-vars/README.md index 7c9065a6..521a91c9 100644 --- a/subjects/devops/set-env-vars/README.md +++ b/subjects/devops/set-env-vars/README.md @@ -15,16 +15,12 @@ $ printenv # The env variables present are just an example, yours will be diffe SHELL=/bin/bash TERM=xterm USER=demouser -LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca:... MAIL=/var/mail/demouser PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games PWD=/home/demouser -LANG=en_US.UTF-8 SHLVL=1 HOME=/home/demouser LOGNAME=demouser -LESSOPEN=| /usr/bin/lesspipe %s -LESSCLOSE=/usr/bin/lesspipe %s %s _=/usr/bin/printenv $ ./set-env-vars.sh MY_NUM=100