So I am trying to have my script ask how many times it needs to do a command, take all the inputs at once, and then run it. So the task it's supposed to do is just take in a bunch of file paths.
echo "How many SVN repositories do you need to convert and commit?"
read repo_numb
echo
for ((i=1; i<=$repo_numb; i++));
do
echo "What is the full path to SVN repository $i?"
read svn_repo_$i
echo $svn_repo_$i
done
But the echo only prints out the $i. How do I get it to create variables svn_repo1, svn_repo2, ... svn_repo$repo_number.
iis 5, yourreadreally does set the value ofsvn_repo_5(the argument undergoes parameter expansion beforereadis called). To access it, you would needname="$svn_repo_$i"; echo ${!name}. The array suggested by anubhava is the correct answer, though.