Olaf Bohlen
2023-01-02 0be391f1cf7ff18758bd53d5dc0302868207987b
receipt-processor.ksh
@@ -81,6 +81,7 @@
   
   # list up that we fetch needed ingredients
   printf "Fetching ingredients from receipt:\n"
   printf "----------------------------------\n"
   i=0
   while [ ${i} -lt ${num_in} ]; do
       in_name=$( echo "${receipt}" | jq -r .spec.ingredients[${i}].name )
@@ -92,7 +93,7 @@
       if [ "x${in_remarks}" != "xnull" ]; then
      printf " (%s)" "${in_remarks}"
       fi
       printf "\n"
       printf "\n\n"
       sleep 1
       i=$(( ${i} + 1 ))
   done
@@ -107,13 +108,14 @@
   # now let's iterate over that
   printf "\n\nProcessing the instructions:\n"
   printf "----------------------------\n"
   i=1
   while [ ${i} -lt ${num_steps} ]; do
   while [ ${i} -le ${num_steps} ]; do
       instruction=$( echo "${receipt}" | jq '.spec.steps[] | select(.order == '${i}') | { instruction } | join (" ")' )
       printf "Step %i/%i: %s..." ${i} ${num_steps} "${instruction}"
       sleep $(( ${RANDOM} % 6 + 1 ))
       printf "done\n"
       printf "done\n\n"
       sleep 1
       i=$(( ${i} + 1 ))
   done