Is there a way to create bash variables and assign them values via a loop?
Something along the lines of:
#!/bin/bash
c=0
for file in $( ls ); do
var"$c"="$file";
let c=$c+1;
done
EDIT: Thank you to @Costas and @mdpc for pointing out this would be a poor alternative to a list; the question is theoretical only.
var"$c"
breaks it. @Costas 's answer demonstrates how to assign multiple values to a single list variable - I'm just asking theoretically whether variables can actually be generated with a loop.