git.slaskete.net
/
einar-bin
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More fixes
[einar-bin]
/
middag.sh
diff --git
a/middag.sh
b/middag.sh
index 38ec5aed2024fb274c6dce0d8b99742449d72c0a..832b0539268213b62feab5ded9d132619eb6b9b2 100755
(executable)
--- a/
middag.sh
+++ b/
middag.sh
@@
-24,8
+24,8
@@
Meat=(
Sides=(
'poteter'
'ris'
Sides=(
'poteter'
'ris'
- 'wokgrønsaker'
- 'kokte grønsaker'
+ 'wokgrøn
n
saker'
+ 'kokte grøn
n
saker'
'fries'
'salat'
'couscous'
'fries'
'salat'
'couscous'
@@
-34,28
+34,13
@@
Sides=(
'potetmos'
)
'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=$RANDOM
-(( PrepN %= $
PrepCount
))
+(( PrepN %= $
{#Prep[@]}
))
MeatN=$RANDOM
MeatN=$RANDOM
-(( MeatN %= $
MeatCount
))
+(( MeatN %= $
{#Meat[@]}
))
SideN=$RANDOM
SideN=$RANDOM
-(( SideN %= $
SideCount
))
+(( SideN %= $
{#Sides[@]}
))
echo "${Prep[PrepN]} ${Meat[MeatN]} med ${Sides[SideN]}"
echo "${Prep[PrepN]} ${Meat[MeatN]} med ${Sides[SideN]}"