Answers for "how to assign values from a loop in bash to a single variabel"

0

how to assign values from a loop in bash to a single variabel

results=()

for time in ${seconds_list}; do
    results+=($(bc -l <<< "scale=2; ($cur_time-$time)/3600"))
done

# print the results:

printf "%s\n" "${results[@]}"
Posted by: Guest on November-19-2020

Code answers related to "how to assign values from a loop in bash to a single variabel"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language