I'm trying to make directories using a variable in the directory name from a variables in an array, but it doesn't seem to concatenate the streams like I thought they would. I've tried a couple different ways.
I'm trying to get three directories named: test_6_bash_with_directory, test_8_bash_with_directory, test_10_bash_with_directory
variable=`seq 6 2 10`
for i in "${variable[@]}"
do
:
directory_name="./test_${i}_bash_with_directory"
mkdir $directory_name
echo $i
done
This gives me three directories test_6, 8 and 10_bash_with_directory. Replacing ${i} with ${variable} has the same result.
I'd also tried having the mkdir call in the same line as the directory concatenation:
mkdir "./test_${i}_bash_with_directory"
and I got one directory called test_6?8?10_bash_with_directory
So, how do I write this correctly? Thank you for replies!