git.slaskete.net
/
einar-bin
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
923533b
)
Overskrev en fin patch ved et uhell, la inn igjen
author
Einar Jørgen Haraldseid
<einar.haraldseid@ntnu.no>
Mon, 14 Jan 2019 14:57:14 +0000
(15:57 +0100)
committer
Einar Jørgen Haraldseid
<einar.haraldseid@ntnu.no>
Mon, 14 Jan 2019 14:57:14 +0000
(15:57 +0100)
middag.sh
patch
|
blob
|
history
diff --git
a/middag.sh
b/middag.sh
index 38ec5aed2024fb274c6dce0d8b99742449d72c0a..ff294c24f147b9ac3ad55647286bcabe8df8ca7f 100755
(executable)
--- a/
middag.sh
+++ b/
middag.sh
@@
-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]}"