You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
227 B

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