Browse Source

fix(array-selector): remove exit command from solution

DEV-4191-DeepInSystem
nprimo 2 years ago committed by Niccolò Primo
parent
commit
c231898bca
  1. 6
      sh/tests/solutions/array-selector.sh

6
sh/tests/solutions/array-selector.sh

@ -6,9 +6,9 @@ IFS='
COLORS=('red' 'blue' 'green' 'white' 'black')
if [[ ! $1 =~ ^[0-9]+$ ]] || [[ $1 -le 0 ]] || [[ $1 -gt ${#COLORS[@]} ]]; then
echo 'Error'
exit 1
else
POS=$(($1 - 1))
echo ${COLORS[$POS]}
fi
POS=$(($1 - 1))
echo ${COLORS[$POS]}

Loading…
Cancel
Save