X-Git-Url: https://git.slaskete.net/einar-bin/blobdiff_plain/923533b96d6643e386aa2b917657fc8384977d69..cc4676f281200e14e3c00f504603b307ed6ed7d5:/middag.sh diff --git a/middag.sh b/middag.sh index 38ec5ae..832b053 100755 --- a/middag.sh +++ b/middag.sh @@ -24,8 +24,8 @@ Meat=( Sides=( 'poteter' 'ris' - 'wokgrønsaker' - 'kokte grønsaker' + 'wokgrønnsaker' + 'kokte grønnsaker' 'fries' 'salat' 'couscous' @@ -34,28 +34,13 @@ Sides=( 'potetmos' ) -PrepCount=0 -while [ "x${Prep[PrepCount]}" != "x" ]; do - ((PrepCount++)) -done - -MeatCount=0 -while [ "x${Meat[MeatCount]}" != "x" ]; do - ((MeatCount++)) -done - -SideCount=0 -while [ "x${Sides[SideCount]}" != "x" ]; do - ((SideCount++)) -done - PrepN=$RANDOM -(( PrepN %= $PrepCount )) +(( PrepN %= ${#Prep[@]} )) MeatN=$RANDOM -(( MeatN %= $MeatCount )) +(( MeatN %= ${#Meat[@]} )) SideN=$RANDOM -(( SideN %= $SideCount )) +(( SideN %= ${#Sides[@]} )) echo "${Prep[PrepN]} ${Meat[MeatN]} med ${Sides[SideN]}"