Can someone solve my headache with the following code. I want to write a bash script that will create a table that contain interval of time according to informations input by a user and display table. this is a part of another program but I got stack with this until command
that is supposed to be easy to use. Sorry! I'm coding in French but the idea is as I explained
#!/bin/bash
read -p "entrez l'heure de depart(exple: hh:mn:06 or hh:mn:36):" beg_time
read -p "entrez l'intervalle de temps en minute(exple: 10):" Inter
read -p "entrez le nombre d'occurence(exple: 4):" Nbre
let "i = 1"
let "Nb = $Nbre"
tab=("$beg_time")
until [ "$i" -eq "$Nb" ]
do
tab["$i"]=`date -j -v '+"$Inter"M' -f "%H:%M:%S" "$beg_time" "+%T"`
let "i += 1"
done
echo ${tab[*]}
but I'm get this as error
line 8: until [ 1: command not found
I need to mention that I'm using a MacOS so the date command may not work on other linux OS. Please help