From 0f07fcdba9f267c96fa141be6eb08ea6b676998d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Einar=20J=C3=B8rgen=20Haraldseid?= Date: Mon, 14 Jan 2019 15:57:14 +0100 Subject: [PATCH] Overskrev en fin patch ved et uhell, la inn igjen --- middag.sh | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/middag.sh b/middag.sh index 38ec5ae..ff294c2 100755 --- a/middag.sh +++ b/middag.sh @@ -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]}" -- 2.30.2