Answer the question
In order to leave comments, you need to log in
2D Bash array?
Good day to all! Ask for advice from experienced people. There is a bash script that carries 2 arrays. I need the 1st value of one array to be on the same line as the value of the 2nd array, and so on. An example of my paws (as I saw it) is below.
array=($timestamp)
array2=($videoname)
array3=(${array[@]}${array2[@]})
echo $array3
I know I'm wrong, but Google didn't help, so I'm asking for advice from all of you .
Answer the question
In order to leave comments, you need to log in
#!/bin/bash
array=(a b c)
array2=(1 2 3)
for (( i=0; i<${#array[@]}; i++ ))
do
echo "${array[$i]}${array2[$i]}"
done
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question