Browse Source

docs(set-env-vars): add hints, fixx the test to block echo and fix solution

pull/1684/head
miguel 1 year ago committed by MSilva95
parent
commit
497b331f9d
  1. 1
      sh/tests/set-env-vars_test.sh
  2. 1
      sh/tests/solutions/set-env-vars.sh
  3. 4
      subjects/devops/set-env-vars/README.md

1
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!"

1
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_"

4
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

Loading…
Cancel
Save