Your question isn't very clear. I guess you're in this situation:
value=( {00..23} ) # <--- this defines an array, unlike your code in the question
i=( 01 02 )
and you want to loop through the arrays value and i and multiply the terms. You don't need expr and bc for this, since you're only dealing with integers. The only catch is that is that you have a leading 0; so we have to take extra care to tell Bash we really mean numbers in radix 10 (and not in radix 8), using the radix specifier 10#. Also, we deal with your formatting problem using printf:
for a in "${i[@]}"; do
for b in "${value[@]}"; do
printf '%02d\n' "$((10#$a*10#$b))"
done
done
This will print to standard out the following:
00
01
02
03
04
[...]
22
23
00
02
04
06
[...]
44
46
If you want to make a new array out of these, proceed as follows:
newarray=()
for a in "${i[@]}"; do
for b in "${value[@]}"; do
printf -v fab '%02d' "$((10#$a*10#$b))"
newarray+=( "$fab" )
done
done
Then,
declare -p newarray
will show:
declare -a newarray='([0]="00" [1]="01" [2]="02" [3]="03" [4]="04" [5]="05" [6]="06" [7]="07" [8]="08" [9]="09" [10]="10" [11]="11" [12]="12" [13]="13" [14]="14" [15]="15" [16]="16" [17]="17" [18]="18" [19]="19" [20]="20" [21]="21" [22]="22" [23]="23" [24]="00" [25]="02" [26]="04" [27]="06" [28]="08" [29]="10" [30]="12" [31]="14" [32]="16" [33]="18" [34]="20" [35]="22" [36]="24" [37]="26" [38]="28" [39]="30" [40]="32" [41]="34" [42]="36" [43]="38" [44]="40" [45]="42" [46]="44" [47]="46")'
Regarding your edit: the line
if [[ "$day"="${days[0]}" ]]; then i=00
is wrong: you need spaces around the = sign (otherwise Bash only tests whether the string obtained by the expansion "$day"="${days[0]}" is not empty… and this string is never empty!—that's because Bash only sees one argument between the [[...]]). Write this instead:
if [[ "$day" = "${days[0]}" ]]; then i=00
Now, actually, your script would be clearer (and shorter and more efficient) without the hard-coded 24, and without this test for each iteration of the loop:
#!/bin/bash
data=$(date +%Y-%m-%d)
data1=$(date -d "1 day" +%Y-%m-%d)
days=( "$data" "$data1" )
values=( {00..23} )
for day in "${days[@]}"; do
for value in "${values[@]}"; do
t=$((10#$i+10#$value))
echo "$t"
done
((i+=${#values[@]}))
done
valueis just a space-separated string.valueis just the (verbatim) string{00..23}.