Is there a way to create bash variables and assign them values via a loop?Something along the lines of:#!/bin/bashc=0for file in $( ls ); do    var$c=$file;    let c=$c+1;doneEDIT: Thank you to @Costas and @mdpc for pointing out this would be a poor alternative to a list; the question is theoretical only.
Create variables and assign values via loop (bash)
bash;shell;shell script
Well, you absolutely can using eval as follows:c=0for file in $( ls ); do    eval var$c=$file;    c=$((c+1));doneThis code will create variables named var0, var1, var2, ... with each one holding the file name. I assume you will have a good reason you want to do that over using an array ...