Sides=(
'poteter'
'ris'
- 'wokgrønsaker'
- 'kokte grønsaker'
+ 'wokgrønnsaker'
+ 'kokte grønnsaker'
'fries'
'salat'
'couscous'
'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]}"